File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM python:3.12.7-alpine AS builder
2- WORKDIR /builder
3-
4- RUN apk update && \
5- apk add --no-cache \
6- build-base \
7- linux-headers
8-
9- # 安装构建依赖
10- RUN pip install --no-cache-dir --upgrade pip && \
11- pip install --no-cache-dir cython setuptools
12-
13- COPY setup.py setup.py
14- COPY app ./app
15-
16- RUN python setup.py
17-
18- RUN apk del build-base linux-headers && \
19- find app -type f \( -name "*.py" ! -name "main.py" ! -name "__init__.py" -o -name "*.c" \) -delete
20-
211FROM python:3.12.7-alpine
222
233ENV TZ=Asia/Shanghai
244VOLUME ["/config" , "/logs" , "/media" ]
255
26- RUN apk update && \
27- apk add --no-cache \
28- build-base \
29- linux-headers
6+ RUN apk update
7+ RUN apk add --no-cache build-base linux-headers tzdata
308
319COPY requirements.txt requirements.txt
32- RUN pip install --no-cache-dir - r requirements.txt && \
33- rm requirements.txt
10+ RUN pip install -r requirements.txt && \
11+ rm requirements.txt
3412
35- COPY --from=builder /builder/ app /app
13+ COPY app /app
3614
37- RUN apk del build-base linux-headers && \
38- rm -rf /tmp/*
15+ RUN rm -rf /tmp/*
3916
4017ENTRYPOINT ["python" , "/app/main.py" ]
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments