Spaces:
Sleeping

File size: 774 Bytes
839aef2
9096e54
 
 
839aef2
 
 
9096e54
839aef2
9096e54
 
720df4a
 
839aef2
720df4a
 
9096e54
839aef2
 
 
 
 
9096e54
839aef2
 
9096e54
839aef2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM node:20-slim

WORKDIR /app

# Install production dependencies first (better layer caching)
COPY package*.json ./
RUN npm ci --omit=dev

# Copy application code (includes pre-built dashboard in ./static and ./apk)
COPY . .

# Hugging Face Spaces run as a non-root user (UID 1000). The node:20 image already
# ships a "node" user at UID 1000, so reuse it instead of creating a duplicate.
RUN mkdir -p /data && \
    chown -R node:node /app /data

USER node

ENV NODE_ENV=production \
    PORT=7860 \
    TZ=UTC

EXPOSE 7860

HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
    CMD node -e "fetch('http://localhost:7860/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"

CMD ["node", "src/server.js"]