This commit is contained in:
whm
2026-03-17 20:01:27 +08:00
parent 4373d2a0ee
commit 2851b0913c
3 changed files with 9 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
# 国内服务器可设 REGISTRY_MIRROR 拉取镜像,例: docker.m.daocloud.io/library/
ARG REGISTRY_MIRROR=
# 国内默认走镜像;海外可 --build-arg REGISTRY_MIRROR= 直连
ARG REGISTRY_MIRROR=docker.m.daocloud.io/library/
FROM ${REGISTRY_MIRROR}node:20-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
@@ -7,7 +7,7 @@ RUN npm ci --legacy-peer-deps 2>/dev/null || npm install --legacy-peer-deps
COPY . .
RUN npm run build
ARG REGISTRY_MIRROR=
ARG REGISTRY_MIRROR=docker.m.daocloud.io/library/
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