Skip to content

Commit

Permalink
Dockerfile: copy requirements.txt after apt
Browse files Browse the repository at this point in the history
This way, modifications to requirements.txt will not trigger apt-get,
slightly reducing wait times during development when adding or updating
requirements.
  • Loading branch information
stintel authored and kristiankielhofner committed Jan 17, 2024
1 parent 8db72a5 commit 7ebae8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ FROM python:3.12.0-slim-bookworm

WORKDIR /app

COPY requirements.txt .

# Install gcc temporarily until wheels for httptools on Python 3.12 are available
RUN apt-get update && apt-get install --no-install-recommends -y gcc libc6-dev libmagic1 && rm -rf /var/lib/apt/lists/*

COPY requirements.txt .

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

COPY . .
Expand Down

0 comments on commit 7ebae8d

Please sign in to comment.