2023-03-23 20:54:51 +03:00
|
|
|
# build stage
|
2023-03-31 02:10:00 +03:00
|
|
|
FROM node:lts-alpine AS build-stage
|
2023-10-30 20:11:16 +03:00
|
|
|
# Set environment variables for non-interactive npm installs
|
|
|
|
ENV NPM_CONFIG_LOGLEVEL warn
|
|
|
|
ENV CI true
|
2023-03-23 20:54:51 +03:00
|
|
|
WORKDIR /app
|
2023-10-30 20:11:16 +03:00
|
|
|
COPY package.json pnpm-lock.yaml ./
|
|
|
|
RUN npm install -g pnpm && pnpm i --frozen-lockfile
|
2023-03-23 20:54:51 +03:00
|
|
|
COPY . .
|
|
|
|
RUN pnpm build
|
|
|
|
|
|
|
|
# production stage
|
2023-11-02 11:10:13 +03:00
|
|
|
FROM nginx:stable-alpine AS production-stage
|
2023-03-23 20:54:51 +03:00
|
|
|
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
2023-03-29 01:11:29 +03:00
|
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
2023-03-23 20:54:51 +03:00
|
|
|
EXPOSE 80
|
2023-11-02 11:10:13 +03:00
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|