api-ix commited on
Commit
6686c2b
·
verified ·
1 Parent(s): 9ccccf0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -5
Dockerfile CHANGED
@@ -34,7 +34,7 @@ RUN apt-get update && \
34
  ###############################################################################
35
  ENV PLAYWRIGHT_BROWSERS_PATH=/home/node/.cache/ms-playwright
36
 
37
- # Run as root to ensure correct install location
38
  USER root
39
  RUN npx playwright install --with-deps chromium && \
40
  mkdir -p /home/node/.cache/ms-playwright && \
@@ -44,12 +44,12 @@ USER node
44
  ###############################################################################
45
  # 3. Startup script (clone repo at run-time like the second Dockerfile)
46
  ###############################################################################
47
- COPY <<'EOF' /usr/local/bin/start.sh
48
  #!/usr/bin/env bash
49
  set -e
50
 
51
- echo "Cloning \$REPO …"
52
- git clone --depth 1 "\$REPO" /tmp/app
53
  cd /tmp/app
54
 
55
  # (Optional) if your repo has devDependencies you need at runtime,
@@ -60,7 +60,7 @@ npm install --omit=dev
60
  chmod -R 777 /tmp/app
61
 
62
  exec npm start
63
- EOF
64
 
65
  RUN chmod +x /usr/local/bin/start.sh
66
 
 
34
  ###############################################################################
35
  ENV PLAYWRIGHT_BROWSERS_PATH=/home/node/.cache/ms-playwright
36
 
37
+ # install as root so chromium is available system-wide, then fix perms
38
  USER root
39
  RUN npx playwright install --with-deps chromium && \
40
  mkdir -p /home/node/.cache/ms-playwright && \
 
44
  ###############################################################################
45
  # 3. Startup script (clone repo at run-time like the second Dockerfile)
46
  ###############################################################################
47
+ COPY <<'start.sh' /usr/local/bin/start.sh
48
  #!/usr/bin/env bash
49
  set -e
50
 
51
+ echo "Cloning $REPO …"
52
+ git clone --depth 1 "$REPO" /tmp/app
53
  cd /tmp/app
54
 
55
  # (Optional) if your repo has devDependencies you need at runtime,
 
60
  chmod -R 777 /tmp/app
61
 
62
  exec npm start
63
+ start.sh
64
 
65
  RUN chmod +x /usr/local/bin/start.sh
66