2023-03-10 01:20:14 +00:00
|
|
|
FROM python:3.11-alpine as pybuilder
|
2023-03-09 15:40:34 +00:00
|
|
|
RUN sed -i 's|v3\.\d*|edge|' /etc/apk/repositories
|
2023-03-22 15:07:14 +00:00
|
|
|
RUN apk update && apk add olm-dev gcc musl-dev tzdata libmagic
|
2023-03-10 01:20:14 +00:00
|
|
|
COPY requirements.txt /requirements.txt
|
|
|
|
RUN pip3 install --user -r /requirements.txt && rm /requirements.txt
|
2023-03-09 15:40:34 +00:00
|
|
|
|
|
|
|
|
2023-03-10 01:20:14 +00:00
|
|
|
FROM python:3.11-alpine as runner
|
2023-03-22 15:07:14 +00:00
|
|
|
RUN apk update && apk add olm-dev libmagic
|
2023-03-10 01:20:14 +00:00
|
|
|
COPY --from=pybuilder /root/.local /usr/local
|
|
|
|
COPY --from=pybuilder /usr/share/zoneinfo /usr/share/zoneinfo
|
|
|
|
COPY . /app
|
2023-03-09 15:40:34 +00:00
|
|
|
|
|
|
|
|
2023-03-10 01:20:14 +00:00
|
|
|
FROM runner
|
|
|
|
ENV TZ=Asia/Shanghai
|
|
|
|
WORKDIR /app
|
|
|
|
CMD ["python", "main.py"]
|
2023-03-09 15:40:34 +00:00
|
|
|
|