2023-04-06 22:05:32 +08:00
|
|
|
FROM python:3.11-alpine as base
|
|
|
|
|
|
|
|
FROM base as pybuilder
|
2023-03-09 23:40:34 +08:00
|
|
|
RUN sed -i 's|v3\.\d*|edge|' /etc/apk/repositories
|
2023-04-10 10:52:18 +08:00
|
|
|
RUN apk update && apk add olm-dev gcc musl-dev libmagic
|
2023-03-10 09:20:14 +08:00
|
|
|
COPY requirements.txt /requirements.txt
|
|
|
|
RUN pip3 install --user -r /requirements.txt && rm /requirements.txt
|
2023-03-09 23:40:34 +08:00
|
|
|
|
|
|
|
|
2023-04-06 22:05:32 +08:00
|
|
|
FROM base as runner
|
2023-03-22 23:40:32 +08:00
|
|
|
LABEL "org.opencontainers.image.source"="https://github.com/hibobmaster/matrix_chatgpt_bot"
|
2023-03-22 23:07:14 +08:00
|
|
|
RUN apk update && apk add olm-dev libmagic
|
2023-03-10 09:20:14 +08:00
|
|
|
COPY --from=pybuilder /root/.local /usr/local
|
|
|
|
COPY . /app
|
2023-03-09 23:40:34 +08:00
|
|
|
|
|
|
|
|
2023-03-10 09:20:14 +08:00
|
|
|
FROM runner
|
|
|
|
WORKDIR /app
|
|
|
|
CMD ["python", "main.py"]
|
2023-03-09 23:40:34 +08:00
|
|
|
|