mrpoddaa commited on
Commit
2f5e032
Β·
verified Β·
1 Parent(s): 1e0c95a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -3
Dockerfile CHANGED
@@ -3,8 +3,13 @@
3
  # ──────────────────────────────────────────────
4
  FROM node:20-slim
5
 
6
- # node:20-slim already has a built-in 'node' user at uid 1000
7
- # DO NOT run useradd β€” uid 1000 already exists and will error
 
 
 
 
 
8
 
9
  WORKDIR /app
10
 
@@ -17,12 +22,13 @@ COPY --chown=node:node . .
17
 
18
  # Hugging Face Spaces requires port 7860
19
  ENV PORT=7860
 
20
  EXPOSE 7860
21
 
22
  # Use the built-in node user (uid 1000) β€” required by HF Spaces
23
  USER node
24
 
25
- # HF pings /system to verify the app is healthy
26
  HEALTHCHECK --interval=30s --timeout=10s --start-period=20s \
27
  CMD node -e "require('http').get('http://localhost:7860/system',r=>{process.exit(r.statusCode===200?0:1)}).on('error',()=>process.exit(1))"
28
 
 
3
  # ──────────────────────────────────────────────
4
  FROM node:20-slim
5
 
6
+ # node:20-slim strips CA certificates β€” MongoDB Atlas TLS will fail without this
7
+ RUN apt-get update && apt-get install -y --no-install-recommends \
8
+ ca-certificates \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # node:20-slim already ships with a 'node' user at uid 1000
12
+ # DO NOT run useradd β€” uid 1000 already exists and will crash the build
13
 
14
  WORKDIR /app
15
 
 
22
 
23
  # Hugging Face Spaces requires port 7860
24
  ENV PORT=7860
25
+ ENV NODE_OPTIONS=--use-openssl-ca
26
  EXPOSE 7860
27
 
28
  # Use the built-in node user (uid 1000) β€” required by HF Spaces
29
  USER node
30
 
31
+ # HF pings /system to verify the app is alive
32
  HEALTHCHECK --interval=30s --timeout=10s --start-period=20s \
33
  CMD node -e "require('http').get('http://localhost:7860/system',r=>{process.exit(r.statusCode===200?0:1)}).on('error',()=>process.exit(1))"
34