Updated Dockerfile with smaller images
This commit is contained in:
parent
1c652f2727
commit
1748639b43
1 changed files with 13 additions and 6 deletions
17
Dockerfile
17
Dockerfile
|
@ -1,17 +1,24 @@
|
|||
FROM python:3.10 as build
|
||||
FROM python:3.10-slim as build
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
RUN pip install poetry
|
||||
COPY ./pyproject.toml ./poetry.lock* /tmp/
|
||||
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
|
||||
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes --without dev
|
||||
|
||||
FROM python:3.10
|
||||
ENV VIRTUAL_ENV=/opt/venv
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
RUN python -m venv $VIRTUAL_ENV && \
|
||||
pip install --no-cache-dir --upgrade -r requirements.txt
|
||||
|
||||
FROM python:3.10-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /tmp/requirements.txt /code/requirements.txt
|
||||
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
||||
ENV VIRTUAL_ENV=/opt/venv
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
|
||||
COPY --from=build $VIRTUAL_ENV $VIRTUAL_ENV
|
||||
|
||||
COPY resa_padel/ /app/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue