Files
order_site/deploy/docker/frontend.Dockerfile
T
2026-05-26 17:11:26 +08:00

30 lines
801 B
Docker

FROM docker.m.daocloud.io/library/node:22-bookworm AS builder
ARG NPM_REGISTRY=https://registry.npmmirror.com
ENV TZ=Asia/Shanghai
ENV NPM_CONFIG_REGISTRY=${NPM_REGISTRY}
WORKDIR /app
COPY apps/frontend/package.json apps/frontend/package-lock.json ./
RUN --mount=type=cache,target=/root/.npm,sharing=locked \
npm ci
COPY apps/frontend/ ./
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 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
COPY deploy/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=builder /app/dist /srv