-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (31 loc) · 903 Bytes
/
Dockerfile
File metadata and controls
40 lines (31 loc) · 903 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
# Stage 1: Build client
FROM node:20-alpine AS client-build
WORKDIR /app/client
COPY client/package*.json ./
RUN npm ci
COPY client/ ./
RUN npm run build
# Stage 2: Build server
FROM node:20-alpine AS server-build
WORKDIR /app/server
COPY server/package*.json ./
RUN npm ci
COPY server/ ./
RUN npm run build
# Stage 3: Production runtime
FROM node:20-alpine
WORKDIR /app
# Install jq for the hook help parsing (exec commands use --help)
RUN apk add --no-cache jq git coreutils
# Copy server production dependencies
COPY server/package*.json ./server/
RUN cd server && npm ci --omit=dev
# Copy built artifacts
COPY --from=server-build /app/server/dist ./server/dist
COPY --from=client-build /app/client/dist ./client/dist
# Copy hook script (for reference/install endpoint)
COPY hook/ ./hook/
# Ensure log file exists
RUN touch /tmp/bashback.log
EXPOSE 3001
CMD ["node", "server/dist/index.js"]