diff --git a/deploy/docker/backend.Dockerfile b/deploy/docker/backend.Dockerfile index d7680411..9c63c5e7 100644 --- a/deploy/docker/backend.Dockerfile +++ b/deploy/docker/backend.Dockerfile @@ -26,6 +26,8 @@ RUN npm run build \ FROM docker.m.daocloud.io/library/node:22-bookworm-slim AS runtime +ARG DEBIAN_MIRROR=mirrors.cloud.tencent.com + ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Asia/Shanghai ENV NODE_ENV=production @@ -34,7 +36,9 @@ WORKDIR /app RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ - apt-get update \ + sed -i "s|http://deb.debian.org/debian|http://${DEBIAN_MIRROR}/debian|g" /etc/apt/sources.list.d/debian.sources \ + && sed -i "s|http://security.debian.org/debian-security|http://${DEBIAN_MIRROR}/debian-security|g" /etc/apt/sources.list.d/debian.sources \ + && apt-get update \ && apt-get install -y --no-install-recommends \ curl ca-certificates tzdata \ && ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime \ diff --git a/deploy/docker/frontend.Dockerfile b/deploy/docker/frontend.Dockerfile index d72fcaae..359968c6 100644 --- a/deploy/docker/frontend.Dockerfile +++ b/deploy/docker/frontend.Dockerfile @@ -16,9 +16,12 @@ RUN npm run build FROM docker.m.daocloud.io/library/caddy:2-alpine +ARG ALPINE_MIRROR=mirrors.cloud.tencent.com + ENV TZ=Asia/Shanghai -RUN apk add --no-cache tzdata \ +RUN sed -i "s|https://dl-cdn.alpinelinux.org/alpine|https://${ALPINE_MIRROR}/alpine|g" /etc/apk/repositories \ + && apk add --no-cache tzdata \ && ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime \ && echo ${TZ} > /etc/timezone