File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ jobs:
222222 uses : actions/download-artifact@v4
223223 with :
224224 name : dist
225- path : backend/src/ dist
225+ path : backend/dist
226226
227227 - name : Build and push
228228 if : ${{ needs.version-info.outputs.release == 1 && needs.version-info.outputs.dev != 1 }}
Original file line number Diff line number Diff line change 44# 构建阶段
55FROM alpine:3.18 AS builder
66
7- ENV VENV_PATH="/opt/venv"
87
98# 安装构建依赖
109RUN apk add --no-cache \
@@ -25,10 +24,10 @@ ENV PATH="/root/.local/bin:$PATH"
2524WORKDIR /build
2625
2726# 复制依赖文件并安装(这层会被缓存,除非依赖文件改变)
28- COPY backend/pyproject.toml backend/uv.lock ./
27+ COPY backend/pyproject.toml backend/uv.lock requirements.txt ./
2928
3029# 安装Python依赖
31- RUN uv sync --frozen --no-dev && mv .venv $VENV_PATH
30+ RUN uv sync --frozen --no-dev
3231
3332# 运行阶段
3433FROM alpine:3.18 AS runtime
@@ -38,8 +37,7 @@ ENV LANG="C.UTF-8" \
3837 PUID=1000 \
3938 PGID=1000 \
4039 UMASK=022 \
41- VENV_PATH="/opt/venv" \
42- PATH="/opt/venv/bin:/root/.local/bin:$PATH"
40+ PATH="/root/.local/bin:$PATH"
4341
4442WORKDIR /app
4543
@@ -65,10 +63,11 @@ RUN set -ex && \
6563 rm -rf /var/cache/apk/* /tmp/*
6664
6765# 从构建阶段复制虚拟环境
68- COPY --from=builder $VENV_PATH $VENV_PATH
66+ # COPY --from=builder $VENV_PATH $VENV_PATH
67+ COPY --from=builder .venv .venv
6968
7069# 复制应用代码(放在最后,因为代码变更最频繁)
71- COPY --chmod=755 backend/src/. .
70+ COPY --chmod=755 backend/src/. ./src
7271COPY --chmod=755 entrypoint.sh /entrypoint.sh
7372
7473ENTRYPOINT ["tini" , "-g" , "--" , "/entrypoint.sh" ]
You can’t perform that action at this time.
0 commit comments