Skip to content

Commit

Permalink
Reduce Docker image size (#30)
Browse files Browse the repository at this point in the history
* Copy only required files. Avoid .git, tests, logo...
* Clean up pip cache
* Reduced image size in 4 MB

Co-authored-by: Esteban Sánchez <[email protected]>
  • Loading branch information
ngosang and esanchezm authored Jan 13, 2024
1 parent 6f6c4b8 commit 927849f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__pycache__/
.coverage*
.git
.github
.gitignore
.pdm*
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ FROM python:3.12-alpine

# Install package
WORKDIR /code
COPY . .
RUN pip3 install .
COPY pyproject.toml pdm.lock README.md ./
COPY qbittorrent_exporter ./qbittorrent_exporter
RUN pip install . \
&& rm -rf /root/.cache/pip

ENV QBITTORRENT_HOST=""
ENV QBITTORRENT_PORT=""
Expand Down

0 comments on commit 927849f

Please sign in to comment.