-
Notifications
You must be signed in to change notification settings - Fork 230
/
Dockerfile
31 lines (23 loc) · 717 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
# 第一个阶段
FROM python:3.9-buster as builder
RUN apt update && \
apt install -y build-essential && \
pip install -U pip setuptools wheel && \
pip install pdm && \
apt install -y ffmpeg
COPY pyproject.toml pdm.lock README.md /project/
WORKDIR /project
RUN pdm sync -G bot --prod --no-editable
# 第二个阶段
FROM python:3.9-slim-buster as runtime
RUN apt update && \
apt install -y npm && \
npm install pm2 -g && \
apt install -y ffmpeg && \
pip install pdm
VOLUME ["/redis", "/rabbitmq", "/mongodb", "/run.log", ".cache",".montydb",".snapshot"]
WORKDIR /app
COPY --from=builder /project/.venv /app/.venv
COPY pm2.json ./
COPY . /app
CMD [ "pm2-runtime", "pm2.json" ]