fix: build frontend with pnpm in Docker
Build and push Docker image / buildx (push) Has been cancelled
Deploy VitePress site to Pages / build (push) Has been cancelled
Deploy VitePress site to Pages / Deploy (push) Has been cancelled

This commit is contained in:
Lan
2026-06-03 19:56:39 +08:00
parent 6759539078
commit e3ea7825bf
+6 -9
View File
@@ -3,13 +3,16 @@ FROM node:20-alpine AS frontend-builder
RUN apk add --no-cache git python3 make g++
RUN corepack enable && \
corepack prepare pnpm@9.15.9 --activate
WORKDIR /build
# 克隆并构建 2024 主题
RUN git clone --depth 1 https://github.com/vastsa/FileCodeBoxFronted.git /build/fronted-2024 && \
cd /build/fronted-2024 && \
npm install && \
npm run build
pnpm install --frozen-lockfile --prod=false && \
pnpm run build
# 克隆并构建 2023 主题
RUN git clone --depth 1 https://github.com/vastsa/FileCodeBoxFronted2023.git /build/fronted-2023 && \
@@ -47,10 +50,4 @@ ENV HOST="0.0.0.0" \
EXPOSE 12345
# 生产环境启动命令
CMD uvicorn main:app \
--host $HOST \
--port $PORT \
--workers $WORKERS \
--log-level $LOG_LEVEL \
--proxy-headers \
--forwarded-allow-ips "*"
CMD ["sh", "-c", "exec uvicorn main:app --host \"$HOST\" --port \"$PORT\" --workers \"$WORKERS\" --log-level \"$LOG_LEVEL\" --proxy-headers --forwarded-allow-ips '*'"]