Skip to content

Commit

Permalink
build: use copy instead of add in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobLichterfeld committed Mar 15, 2024
1 parent b454998 commit efd69f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- ci: Enable dependabot for pip requirements
- build: Update Python base image to version 3.11-slim-bookworm
- build: reduce the size of the Docker image by cleaning the APT cache
- build: use copy instead of add in dockerfile

### Bug Fixes

Expand Down
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Update pip and install pip requirements
# Update pip
RUN python -m pip install --upgrade pip
ADD src/requirements.txt .

# Copy requirements.txt and install requirements
WORKDIR /requirements
COPY src/requirements.txt .
RUN python -m pip install -r requirements.txt

# Copy the rest of the code
WORKDIR /app
ADD . /app
COPY . /app

# Switching to a non-root user, please refer to https://aka.ms/vscode-docker-python-user-rights
RUN useradd appuser && chown -R appuser /app
Expand Down

0 comments on commit efd69f2

Please sign in to comment.