-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
30 lines (23 loc) · 884 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
# Stage 0, "build-stage", based on Node.js
FROM node:16.15.0 as build-stage
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY pnpm-lock.yaml .gitignore ./
COPY . .
# If you are building your code for production
#RUN npm install --only=production
# RUN npm cache verify
RUN npm i -g pnpm
RUN pnpm config set store-dir /usr/src/app/.pnpm-store
RUN pnpm install
RUN pnpm build-only
# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginx:latest
COPY --from=build-stage /usr/src/app/dist /usr/share/nginx/html
# Copy the default nginx.conf
# COPY --from=build-stage /usr/src/app/nginx.conf /etc/nginx/nginx.conf
COPY --from=build-stage /usr/src/app/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80