更新 front/Dockerfile

This commit is contained in:
2026-02-11 13:47:37 +08:00
parent 81df5918c9
commit 8f94930e4d

View File

@@ -1,7 +1,12 @@
FROM 172.31.127.251:8083/library/node:20.19.0-alpine as builder
ARG ENV=prod
# 1. 定义构建参数
ARG COMMIT_ID=unknown
# 2. 将参数设置为环境变量,这样在容器运行时也能读取到
ENV GIT_COMMIT_ID=${COMMIT_ID}
WORKDIR /usr/src/app
COPY . .
RUN set -eux; \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories; \
apk update && apk upgrade; \
@@ -9,6 +14,7 @@ RUN set -eux; \
apk add pnpm; \
pnpm config set registry https://registry.npmmirror.com; \
pnpm install; \
echo "Building revision: ${GIT_COMMIT_ID}"; \
pnpm build:$ENV;
FROM 172.31.127.251:8083/library/fileserver:1.0.0