-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (22 loc) · 779 Bytes
/
Dockerfile
File metadata and controls
25 lines (22 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
# Stage 1: build stage
FROM node:22-alpine as build-stage
# make the 'app' folder the current working directory
WORKDIR /app
# config node options
ENV NODE_OPTIONS=--max_old_space_size=8192
# config pnpm, install dependencies
COPY package.json pnpm-lock.yaml* ./
RUN npm install pnpm@9.x -g && \
pnpm install --frozen-lockfile
# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . ./
# build the project
RUN pnpm build
RUN echo "build successful 🎉 🎉 🎉"
# Stage 2: production stage
FROM nginx:latest as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
RUN echo "deploy to nginx successful 🎉 🎉 🎉"