-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (30 loc) · 1015 Bytes
/
Dockerfile
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
# =============================================================================
# Build stage
# =============================================================================
FROM --platform=linux/amd64 node:18-alpine3.18 AS builder
LABEL authors="asrient"
WORKDIR /build
# Copy source code
COPY web ./web
COPY apps ./apps
# Install dependencies and build
RUN cd web && npm ci && \
npm run build
RUN cd apps && npm ci && \
NODE_ENV=production npm run build
# ============================================================================= \
# Production stage
# =============================================================================
FROM --platform=linux/amd64 node:18-alpine3.18
LABEL authors="asrient"
WORKDIR /app
ENV NODE_ENV production
ENV PORT 5000
# Copy source code
COPY --from=builder /build/apps/bin/node ./bin/node
COPY --from=builder /build/web/out ./bin/web
COPY apps/package*.json ./
RUN npm ci --production
EXPOSE 5000
# Start the server
CMD ["npm", "run", "start:node:prod"]