generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
33 lines (22 loc) · 829 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3.11 as requirements-stage
WORKDIR /tmp
COPY ./pyproject.toml ./poetry.lock* /tmp/
RUN curl -sSL https://install.python-poetry.org -o install-poetry.py
RUN python install-poetry.py --yes
ENV PATH="${PATH}:/root/.local/bin"
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
FROM python:3.11-slim-bullseye
# 设置时区
ENV TZ=Asia/Shanghai
# 安装依赖
COPY --from=requirements-stage /tmp/requirements.txt /app/requirements.txt
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y --no-install-recommends git \
&& pip install --no-cache-dir --upgrade -r /app/requirements.txt \
&& apt-get purge -y --auto-remove \
&& rm -rf /var/lib/apt/lists/* \
&& rm /app/requirements.txt
COPY bot.py .env /app/
COPY src /app/src/
CMD ["python", "/app/bot.py"]