-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (24 loc) · 779 Bytes
/
Dockerfile
File metadata and controls
34 lines (24 loc) · 779 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
# Stage 1: Builder stage
FROM node:18.19.0 AS builder
WORKDIR /app
# Copy package.json and yarn.lock files
COPY package.json yarn.lock ./
# Copy the rest of the application code
COPY . .
# Install dependencies
RUN rm -rf node_modules
RUN yarn install --frozen-lockfile --network-timeout 600000
RUN yarn global add patch-package
# Build the application
RUN yarn build
# Stage 2: Production stage
FROM node:18.19.0-slim
WORKDIR /app
# Copy built files and node_modules from the builder stage
COPY --from=builder /app/build ./build
COPY --from=builder /app/bin ./bin
COPY --from=builder /app/package.json ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/patches ./patches
# Set entry point
ENTRYPOINT ["node", "./bin/afj-rest.js", "start"]