-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 749 Bytes
/
Dockerfile
File metadata and controls
33 lines (23 loc) · 749 Bytes
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
29
30
31
32
33
FROM node:22-alpine
# Update packages for security patches
RUN apk upgrade --no-cache
# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
WORKDIR /app
# Copy package files
COPY --chown=nodejs:nodejs package*.json ./
# Install production dependencies only
RUN npm ci --omit=dev && \
npm cache clean --force
# Copy application code
COPY --chown=nodejs:nodejs . .
# Switch to non-root user
USER nodejs
# Expose default port (can be overridden in config.json)
EXPOSE 3000
# Health check - reads port from config.json dynamically
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD node /app/scripts/healthcheck.js
# Run the proxy
CMD ["node", "--no-deprecation", "index.js"]