From 2851b0913c974ec81a4c1d53b9dab693bf890152 Mon Sep 17 00:00:00 2001 From: whm <973418690@qq.com> Date: Tue, 17 Mar 2026 20:01:27 +0800 Subject: [PATCH] 1 --- admin/Dockerfile | 6 +++--- server/Dockerfile | 6 +++--- web/Dockerfile | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/admin/Dockerfile b/admin/Dockerfile index 9d3832d..0df175d 100644 --- a/admin/Dockerfile +++ b/admin/Dockerfile @@ -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 diff --git a/server/Dockerfile b/server/Dockerfile index 515fab7..bce0ad0 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,7 +1,7 @@ # 需在项目根目录构建: docker build -f server/Dockerfile . # 使用 vendor 构建,无需在构建时访问 proxy.golang.org(服务器无外网时也能 build) -# 国内服务器可设 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}golang:1.21-alpine AS builder WORKDIR /build COPY server/ ./ @@ -10,7 +10,7 @@ ARG GOPROXY=https://goproxy.cn,direct ENV GOPROXY=$GOPROXY RUN CGO_ENABLED=0 go build -mod=vendor -o /app/server . -ARG REGISTRY_MIRROR= +ARG REGISTRY_MIRROR=docker.m.daocloud.io/library/ FROM ${REGISTRY_MIRROR}alpine:3.19 WORKDIR /app RUN apk add --no-cache ca-certificates tzdata diff --git a/web/Dockerfile b/web/Dockerfile index 2b651f5..718c7a2 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,5 +1,5 @@ -# 国内服务器可设 REGISTRY_MIRROR 拉取镜像,例: docker.m.daocloud.io -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; root /usr/share/nginx/html; index index.html; location / { try_files $uri $uri/ /index.html; } }' > /etc/nginx/conf.d/default.conf