Dockerfile 490 B

1234567891011121314151617
  1. # build stage
  2. FROM node:lts-alpine AS build-stage
  3. # Set environment variables for non-interactive npm installs
  4. ENV NPM_CONFIG_LOGLEVEL warn
  5. ENV CI true
  6. WORKDIR /app
  7. COPY package.json pnpm-lock.yaml ./
  8. RUN npm install -g pnpm && pnpm i --frozen-lockfile
  9. COPY . .
  10. RUN pnpm build
  11. # production stage
  12. FROM nginx:stable-alpine AS production-stage
  13. COPY --from=build-stage /app/dist /usr/share/nginx/html
  14. COPY nginx.conf /etc/nginx/conf.d/default.conf
  15. EXPOSE 80
  16. CMD ["nginx", "-g", "daemon off;"]