Skip to content

Commit

Permalink
fix: Dockerfile cache directories
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumedsde committed Sep 21, 2023
1 parent ef27135 commit 21f5f40
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 @@ -7,20 +7,20 @@ WORKDIR /app

# NOTE: we use a special cache mount for the pip cache
# hadolint ignore=DL3042
RUN --mount=type=cache,target=/home/nonroot/.cache,id=pip-cache-poetry-install \
RUN --mount=type=cache,target=~/.cache,id=pip-cache-poetry-install \
pip install "poetry==1.4.2"

COPY --chown=nonroot:nonroot pyproject.toml poetry.* ./

# NOTE: add poetry to path
ARG PATH="$PATH:/home/nonroot/.local/bin"
ARG PATH="$PATH:~/.local/bin"
ARG POETRY_NO_INTERACTION=true
ARG POETRY_VIRTUALENVS_OPTIONS_NO_SETUPTOOLS=true
ARG POETRY_VIRTUALENVS_OPTIONS_NO_PIP=true
ARG POETRY_VIRTUALENVS_OPTIONS_ALWAYS_COPY=true

# FIXME: figure out why cache is not working
RUN --mount=type=cache,target=/home/nonroot/.cache,id=poetry-install \
RUN --mount=type=cache,target=~/.cache,id=poetry-install \
poetry install --sync --no-root --only main \
&& rm -rf .venv/pyvenv.cfg .venv/src .venv/.gitignore

Expand Down

0 comments on commit 21f5f40

Please sign in to comment.