Update Dockerfile
Browse files- Dockerfile +8 -58
Dockerfile
CHANGED
|
@@ -1,65 +1,15 @@
|
|
| 1 |
-
FROM node:
|
| 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 |
-
|
| 47 |
-
git clone --depth 1 "$REPO" /tmp/app
|
| 48 |
-
cd /tmp/app
|
| 49 |
|
| 50 |
-
|
| 51 |
-
# drop the --omit=dev flag.
|
| 52 |
-
npm install fs-extra express cors crypto bcrypt axios jsonwebtoken express-rate-limit node-cron mongodb --omit=dev
|
| 53 |
|
| 54 |
-
# Ensure the app can write wherever it needs
|
| 55 |
-
chmod -R 777 /tmp/app
|
| 56 |
-
|
| 57 |
-
exec node app
|
| 58 |
-
start.sh
|
| 59 |
-
RUN chmod +x /usr/local/bin/start.sh
|
| 60 |
-
|
| 61 |
-
###############################################################################
|
| 62 |
-
# 4. Container metadata
|
| 63 |
-
###############################################################################
|
| 64 |
EXPOSE 7860
|
| 65 |
-
|
|
|
|
|
|
| 1 |
+
FROM node:18
|
| 2 |
|
| 3 |
+
RUN apt-get update && apt-get install -y git
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
RUN git clone https://github.com/BLUEXDEMONl/codenest.git /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
RUN npm install cors express-rate-limit express axios bcrypt fs-extra mongodb cors jsonwebtoken node-cron dotenv crypto
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
RUN chmod -R 777 /app
|
|
|
|
|
|
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
EXPOSE 7860
|
| 14 |
+
|
| 15 |
+
CMD ["node", "app.js"]
|