EmmyHenz001 commited on
Commit
ea292aa
·
verified ·
1 Parent(s): 15476df

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +65 -0
Dockerfile ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:24-bullseye-slim
2
+
3
+ ###############################################################################
4
+ # 1. Install everything we need in one layer
5
+ ###############################################################################
6
+ RUN apt-get update && \
7
+ apt-get install -y --no-install-recommends \
8
+ # Basic tools
9
+ git ca-certificates python3 python3-pip build-essential make \
10
+ wget curl unzip \
11
+ # Chrome/Playwright deps copied from the first Dockerfile
12
+ fonts-liberation \
13
+ libasound2 \
14
+ libatk-bridge2.0-0 \
15
+ libatk1.0-0 \
16
+ libcups2 \
17
+ libdbus-1-3 \
18
+ libgbm-dev \
19
+ libnspr4 \
20
+ libnss3 \
21
+ libxcomposite1 \
22
+ libxdamage1 \
23
+ libxfixes3 \
24
+ libxrandr2 \
25
+ xdg-utils \
26
+ libu2f-udev \
27
+ libvulkan1 \
28
+ # Virtual display for headless Chrome
29
+ xvfb \
30
+ && rm -rf /var/lib/apt/lists/*
31
+
32
+ ###############################################################################
33
+ # 2. Install Playwright and browsers globally (kept for future use)
34
+ ###############################################################################
35
+ ENV PLAYWRIGHT_BROWSERS_PATH=/home/node/.cache/ms-playwright
36
+ RUN npx playwright install --with-deps chromium && \
37
+ chmod -R 777 /home/node/.cache/ms-playwright
38
+
39
+ ###############################################################################
40
+ # 3. Startup script (clone repo at run-time like the second Dockerfile)
41
+ ###############################################################################
42
+ COPY <<'start.sh' /usr/local/bin/start.sh
43
+ #!/usr/bin/env bash
44
+ set -e
45
+
46
+ echo "Cloning $REPO …"
47
+ git clone --depth 1 "$REPO" /tmp/app
48
+ cd /tmp/app
49
+
50
+ # (Optional) if your repo has devDependencies you need at runtime,
51
+ # drop the --omit=dev flag.
52
+ npm install --omit=dev
53
+
54
+ # Ensure the app can write wherever it needs
55
+ chmod -R 777 /tmp/app
56
+
57
+ exec npm start
58
+ start.sh
59
+ RUN chmod +x /usr/local/bin/start.sh
60
+
61
+ ###############################################################################
62
+ # 4. Container metadata
63
+ ###############################################################################
64
+ EXPOSE 7860
65
+ CMD ["/usr/local/bin/start.sh"]