Skip to content

Commit

Permalink
Merge pull request #839 from readthedocs/davidfischer/docker-pip-cache
Browse files Browse the repository at this point in the history
Use a docker pip cache
  • Loading branch information
davidfischer committed Mar 6, 2024
2 parents 8e6f6b5 + 1d4df73 commit 9a173cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docker-compose/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ RUN apt-get -y install \
lsb-release

# Requirements are installed here to ensure they will be cached.
# https://docs.docker.com/build/cache/#use-the-dedicated-run-cache
COPY ./requirements /requirements
RUN pip install --upgrade pip
RUN pip install -r /requirements/development.txt
RUN pip install -r /requirements/production.txt
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /requirements/development.txt
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /requirements/production.txt

# Comment this if you don't need the page/topic analyzer.
# The analyzer is used to target ads better based on page content.
# Its requirements are huge and include PyTorch and other ML tools.
# If not needed, make sure to set `ADSERVER_ANALYZER_BACKEND=` (empty string)
# in your environment file `./envs/local/django`.
RUN pip install -r /requirements/analyzer.txt
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /requirements/analyzer.txt

COPY ./docker-compose/django/start /start
RUN chmod +x /start
Expand Down

0 comments on commit 9a173cf

Please sign in to comment.