File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,14 +7,14 @@ FROM alpine:3.18 AS builder
77
88# 安装构建依赖
99RUN apk add --no-cache \
10- python3 \
11- python3-dev \
12- gcc \
13- musl-dev \
14- libffi-dev \
15- rust \
16- cargo \
17- curl
10+ python3 \
11+ python3-dev \
12+ gcc \
13+ musl-dev \
14+ libffi-dev \
15+ rust \
16+ cargo \
17+ curl
1818
1919# 安装 uv
2020RUN curl -LsSf https://astral.sh/uv/install.sh | sh
@@ -33,38 +33,38 @@ RUN uv sync --frozen --no-dev
3333FROM alpine:3.18 AS runtime
3434
3535ENV LANG="C.UTF-8" \
36- TZ=Asia/Shanghai \
37- PUID=1000 \
38- PGID=1000 \
39- UMASK=022 \
40- PATH="/root/.local/bin:$PATH"
36+ TZ=Asia/Shanghai \
37+ PUID=1000 \
38+ PGID=1000 \
39+ UMASK=022 \
40+ PATH="/root/.local/bin:$PATH"
4141
4242WORKDIR /app
4343
4444# 只安装运行时依赖
4545RUN set -ex && \
46- apk add --no-cache \
47- bash \
48- busybox-suid \
49- python3 \
50- py3-aiohttp \
51- py3-bcrypt \
52- curl \
53- su-exec \
54- shadow \
55- tini \
56- openssl \
57- tzdata && \
58- # 添加用户
59- mkdir -p /home/ab && \
60- addgroup -S ab -g 911 && \
61- adduser -S ab -G ab -h /home/ab -s /sbin/nologin -u 911 && \
62- # 清理缓存
63- rm -rf /var/cache/apk/* /tmp/*
46+ apk add --no-cache \
47+ bash \
48+ busybox-suid \
49+ python3 \
50+ py3-aiohttp \
51+ py3-bcrypt \
52+ curl \
53+ su-exec \
54+ shadow \
55+ tini \
56+ openssl \
57+ tzdata && \
58+ # 添加用户
59+ mkdir -p /home/ab && \
60+ addgroup -S ab -g 911 && \
61+ adduser -S ab -G ab -h /home/ab -s /sbin/nologin -u 911 && \
62+ # 清理缓存
63+ rm -rf /var/cache/apk/* /tmp/*
6464
6565# 从构建阶段复制虚拟环境
6666# COPY --from=builder $VENV_PATH $VENV_PATH
67- COPY --from=builder /app /.venv /app/.venv
67+ COPY --from=builder /build /.venv /app/.venv
6868
6969# 复制应用代码(放在最后,因为代码变更最频繁)
7070COPY --chmod=755 backend/src/. ./src
You can’t perform that action at this time.
0 commit comments