feat: docker部署方案

This commit is contained in:
osiris
2024-05-15 17:21:54 +08:00
parent ad8a1179cd
commit 097d8fc0b8
15 changed files with 128 additions and 395 deletions
+16
View File
@@ -0,0 +1,16 @@
# build stage
FROM node:18-alpine3.19 AS build-stage
# Set environment variables for non-interactive npm installs
ENV NPM_CONFIG_LOGLEVEL warn
WORKDIR /app
COPY . .
COPY .env.example .env.development
RUN npm install -g pnpm && pnpm i
RUN pnpm build
# production stage
FROM nginx:stable-alpine AS production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]