docs(examples/python-poetry): clean up containerfile

This commit is contained in:
xyhhx 2024-04-05 16:59:36 -04:00
parent ac909562fa
commit 24e6ac30a4
No known key found for this signature in database
GPG key ID: 21955DADF87F80E8

View file

@ -2,21 +2,21 @@ FROM scratch AS base
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/openssl . /
COPY --from=stagex/python:3.12.0 . /
COPY --from=stagex/python . /
COPY --from=stagex/zlib . /
RUN python -m ensurepip --upgrade
RUN python -m pip install --upgrade pip
FROM base AS requirements
FROM base AS fetch
RUN python -m pip install poetry
WORKDIR /tmp
COPY ./pyproject.toml ./poetry.lock* .
RUN python -m poetry export -f requirements.txt --output requirements.txt --without-hashes
RUN python -m poetry export -f requirements.txt --output requirements.txt
FROM base AS build
WORKDIR /app
COPY --from=requirements /tmp/requirements.txt .
COPY --from=fetch /tmp/requirements.txt .
RUN python -m pip install --no-cache-dir --upgrade -r ./requirements.txt
COPY . .
COPY src/ .
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "80"]