-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (32 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
44 lines (32 loc) · 1.18 KB
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
34
35
36
37
38
39
40
41
42
43
44
# ── Stage 1: Build frontend ───────────────────────────────────────────────
FROM node:24-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY client/ client/
COPY vite.config.js ./
RUN npm run build
# ── Stage 2: Runtime ──────────────────────────────────────────────────────
FROM node:24-alpine AS runtime
WORKDIR /app
RUN addgroup -S sshweb && adduser -S sshweb -G sshweb
RUN apk add --no-cache su-exec
COPY package*.json ./
RUN npm install --omit=dev --omit=optional
COPY server/ server/
COPY --from=builder /app/dist dist/
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN mkdir -p /data
VOLUME ["/data"]
ENV PORT=3000 \
DATA_DIR=/data \
SESSION_TIMEOUT_MINUTES=60 \
MAX_SESSIONS=10 \
LOG_LEVEL=info \
NODE_ENV=production
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=10s \
CMD wget -qO- http://localhost:3000/health || exit 1
ENTRYPOINT ["/entrypoint.sh"]
CMD ["node", "server/index.js"]