-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (37 loc) · 1023 Bytes
/
Dockerfile
File metadata and controls
54 lines (37 loc) · 1023 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Build stage - Full project (frontend + backend)
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package.json package-lock.json ./
COPY server/package.json server/
# Install all dependencies
RUN npm ci
# Copy source
COPY . .
# Build frontend
RUN npm run build
# Build backend
WORKDIR /app/server
RUN npm run build
# Production stage
FROM node:20-alpine
WORKDIR /app
# Copy built frontend to public/
COPY --from=builder /app/dist ./public
# Copy built backend
COPY --from=builder /app/server/dist ./dist
COPY --from=builder /app/server/package.json ./
# Copy shared config (ports.json)
COPY --from=builder /app/shared ./shared
# Install production dependencies only
RUN npm install --omit=dev
# Create data directory for configs
RUN mkdir -p /app/data/config
ENV NODE_ENV=production
ENV PORT=8080
ENV CONFIG_DIR=/app/data/config
# tini ensures proper signal handling (Ctrl+C works)
RUN apk add --no-cache tini
ENTRYPOINT ["/sbin/tini", "--"]
EXPOSE 8080
CMD ["node", "dist/index.js"]