Skip to content

Commit 6d863e1

Browse files
committed
build: 移除 cython 编译
1 parent 5d7000c commit 6d863e1

2 files changed

Lines changed: 6 additions & 70 deletions

File tree

Dockerfile

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,17 @@
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-
211
FROM python:3.12.7-alpine
222

233
ENV TZ=Asia/Shanghai
244
VOLUME ["/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

319
COPY 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

4017
ENTRYPOINT ["python", "/app/main.py"]

setup.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)