Skip to content

Commit

Permalink
remove cache to make docker reuse layer
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Sep 20, 2024
1 parent 5904017 commit c8e078b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ WORKDIR /app
ENV PIP_ROOT_USER_ACTION=ignore

COPY requirements-poetry.txt ./
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip install -r requirements-poetry.txt
RUN pip install -r requirements-poetry.txt

COPY pyproject.toml poetry.lock ./
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked poetry export -f requirements.txt --output requirements.txt
RUN poetry export -f requirements.txt --output requirements.txt

### final image ###
FROM python:3.10-slim@sha256:80619a5316afae7045a3c13371b0ee670f39bac46ea1ed35081d2bf91d6c3dbd
Expand All @@ -24,7 +24,7 @@ COPY --from=poetry /app/requirements.txt ./requirements.txt

ENV PIP_ROOT_USER_ACTION=ignore

RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip install -U pip && \
RUN pip install -U pip && \
pip install -r requirements.txt

WORKDIR /app
Expand Down

0 comments on commit c8e078b

Please sign in to comment.