Subham9126 commited on
Commit
a3d980f
·
verified ·
1 Parent(s): f202b8e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +64 -6
Dockerfile CHANGED
@@ -1,9 +1,67 @@
1
- # Use the correct GitHub Container Registry path
2
- FROM ghcr.io/chartdb/chartdb:latest
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
- # HF Spaces requires the app to listen on port 7860
5
- ENV PORT 7860
6
  EXPOSE 7860
7
 
8
- # Command to start ChartDB
9
- CMD ["npm", "start"]
 
1
+ FROM node:20-slim
2
+
3
+ ARG CAMOUFOX_VERSION=135.0.1
4
+ ARG CAMOUFOX_RELEASE=beta.24
5
+ ARG TARGETARCH
6
+
7
+ RUN apt-get update && apt-get install -y \
8
+ libgtk-3-0 \
9
+ libdbus-glib-1-2 \
10
+ libxt6 \
11
+ libasound2 \
12
+ libx11-xcb1 \
13
+ libxcomposite1 \
14
+ libxcursor1 \
15
+ libxdamage1 \
16
+ libxfixes3 \
17
+ libxi6 \
18
+ libxrandr2 \
19
+ libxrender1 \
20
+ libxss1 \
21
+ libxtst6 \
22
+ libegl1-mesa \
23
+ libgl1-mesa-dri \
24
+ libgbm1 \
25
+ xvfb \
26
+ fonts-liberation \
27
+ fonts-noto-color-emoji \
28
+ fontconfig \
29
+ ca-certificates \
30
+ curl \
31
+ unzip \
32
+ python3-minimal \
33
+ git \
34
+ && rm -rf /var/lib/apt/lists/*
35
+
36
+ WORKDIR /app
37
+
38
+ # Clone Camofox
39
+ RUN git clone --depth 1 https://github.com/jo-inc/camofox-browser.git .
40
+
41
+ # Install dependencies
42
+ RUN PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm ci --production
43
+
44
+ # Download Camoufox
45
+ RUN set -eux; \
46
+ case "${TARGETARCH}" in \
47
+ amd64) CAMOUFOX_ARCH="x86_64"; YTDLP_SUFFIX="" ;; \
48
+ arm64) CAMOUFOX_ARCH="arm64"; YTDLP_SUFFIX="_aarch64" ;; \
49
+ *) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \
50
+ esac; \
51
+ mkdir -p /root/.cache/camoufox; \
52
+ curl -fSL \
53
+ "https://github.com/daijro/camoufox/releases/download/v${CAMOUFOX_VERSION}-${CAMOUFOX_RELEASE}/camoufox-${CAMOUFOX_VERSION}-${CAMOUFOX_RELEASE}-lin.${CAMOUFOX_ARCH}.zip" \
54
+ -o /tmp/camoufox.zip; \
55
+ unzip -q /tmp/camoufox.zip -d /root/.cache/camoufox; \
56
+ chmod -R 755 /root/.cache/camoufox; \
57
+ echo "{\"version\":\"${CAMOUFOX_VERSION}\",\"release\":\"${CAMOUFOX_RELEASE}\"}" \
58
+ > /root/.cache/camoufox/version.json; \
59
+ rm /tmp/camoufox.zip
60
+
61
+ ENV NODE_ENV=production
62
+ ENV CAMOFOX_PORT=7860
63
+ ENV PORT=7860
64
 
 
 
65
  EXPOSE 7860
66
 
67
+ CMD ["sh", "-c", "node --max-old-space-size=${MAX_OLD_SPACE_SIZE:-128} server.js"]