feat: docker部署方案
This commit is contained in:
+16
@@ -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;"]
|
||||
Reference in New Issue
Block a user