-
-
Notifications
You must be signed in to change notification settings - Fork 467
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (19 loc) · 560 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (19 loc) · 560 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
# Stage 1: Build
FROM node:latest AS build
WORKDIR /src/dev/app
COPY package.json /src/dev/app
# Install dependencies
RUN npm install -g pnpm && pnpm install
# Copy the rest of the application code
COPY . /src/dev/app
# Stage 2: Production
FROM node:alpine AS production
WORKDIR /src/prod/app
# Copy only necessary files from the build stage
COPY --from=build /src/dev/app /src/prod/app
# Install pnpm in the production stage
RUN npm install -g pnpm
# Expose port
EXPOSE 3000
# Command to run the application in production
CMD ["pnpm", "run", "dev"]