File size: 1,097 Bytes
2c72272
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM node:24-alpine

###############################################################################
# 1. Install only necessary packages
###############################################################################
RUN apk add --no-cache \
        git \
        bash \
        build-base \
        curl \
        wget \
        unzip \
        ca-certificates

###############################################################################
# 2. Startup script (clone repo at run-time)
###############################################################################
COPY <<'start.sh' /usr/local/bin/start.sh
#!/usr/bin/env bash
set -e

echo "Cloning $REPO …"
git clone --depth 1 "$REPO" /tmp/app
cd /tmp/app

# Install dependencies without devDependencies
npm install --omit=dev

chmod -R 777 /tmp/app

exec npm start
start.sh
RUN chmod +x /usr/local/bin/start.sh

###############################################################################
# 3. Container metadata
###############################################################################
EXPOSE 7860
CMD ["/usr/local/bin/start.sh"]