前端双部署
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# 完整后台前端
|
||||
FROM registry-vpc.cn-chengdu.aliyuncs.com/zhixueli-prod/node:18.20.3 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
RUN npm config set registry https://registry.npmmirror.com/
|
||||
RUN npm config set fetch-retries 3
|
||||
RUN npm config set fetch-retry-mintimeout 5000
|
||||
RUN npm config set fetch-retry-maxtimeout 60000
|
||||
RUN npm install -g pnpm@10.16.1
|
||||
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm config set registry https://registry.npmmirror.com/
|
||||
RUN pnpm install --frozen-lockfile --fetch-timeout 300000
|
||||
|
||||
COPY . .
|
||||
RUN npm run build:admin
|
||||
|
||||
FROM registry-vpc.cn-chengdu.aliyuncs.com/zhixueli-prod/nginx:alpine
|
||||
COPY --from=builder --chown=nginx:nginx /app/dist-admin /usr/share/nginx/html
|
||||
COPY Dockerfiles/admin.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user