1
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
FROM node:20-alpine AS builder
|
||||
# 国内服务器可设 REGISTRY_MIRROR 拉取镜像,例: docker.m.daocloud.io/library/
|
||||
ARG REGISTRY_MIRROR=
|
||||
FROM ${REGISTRY_MIRROR}node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm ci --legacy-peer-deps 2>/dev/null || npm install --legacy-peer-deps
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine
|
||||
ARG REGISTRY_MIRROR=
|
||||
FROM ${REGISTRY_MIRROR}nginx:alpine
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
RUN echo 'server { listen 80; location /admin/ { alias /usr/share/nginx/html/; try_files $uri $uri/ /admin/index.html; } }' > /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
|
||||
Reference in New Issue
Block a user