Skip to content

Commit

Permalink
🏗️ chore: Update Python version in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
sudoskys committed Nov 26, 2023
1 parent 90332f0 commit fdc9613
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# 第一个阶段
FROM python:3.11-buster as builder
FROM python:3.9-buster as builder

RUN apt update && \
apt install -y build-essential && \
pip install -U pip setuptools wheel && \
pip install pdm

COPY pyproject.toml pdm.lock README.md /app/
COPY llmkira /app/llmkira

WORKDIR /app
COPY pyproject.toml pdm.lock README.md /project/
WORKDIR /project
RUN mkdir __pypackages__ && pdm sync -G bot --prod --no-editable

# 第二个阶段
FROM python:3.11-slim-buster as runtime
FROM python:3.9-slim-buster as runtime

RUN apt update && \
apt install -y npm && \
Expand All @@ -22,10 +20,13 @@ RUN apt update && \

VOLUME ["/redis", "/rabbitmq", "/mongodb", "/run.log", "/config_dir"]

ENV PYTHONPATH=/project/pkgs
COPY --from=builder /app/__pypackages__/3.11/lib /project/pkgs
# retrieve packages from build stage
ENV PATH="/bin:$PATH"
ENV PYTHONPATH="/project/pkgs:$PYTHONPATH"
COPY --from=builder /project/__pypackages__/3.9/lib /project/pkgs
# retrieve executables
COPY --from=builder /app/__pypackages__/3.11/bin/* /bin/
COPY --from=builder /project/__pypackages__/3.9/bin/* /bin/


WORKDIR /app
COPY pm2.json ./
Expand Down

0 comments on commit fdc9613

Please sign in to comment.