From 6985672370c8cf7eff716f2f882bda58ddbb839b Mon Sep 17 00:00:00 2001 From: Sylvain Leclerc Date: Tue, 22 Oct 2024 17:33:29 +0200 Subject: [PATCH] fix(docker): reduce docker image size (#2195) Not installing PyQt in docker image saves around 200 Mo. Not keeping pip cache saves again another ~200 Mo. Signed-off-by: Sylvain Leclerc --- .github/workflows/deploy.yml | 1 - Dockerfile | 4 ++-- README.md | 1 - requirements-desktop.txt | 4 ++++ requirements-dev.txt | 1 + requirements.txt | 1 - 6 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 requirements-desktop.txt diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e34aef58ae..b67a63c435 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -47,7 +47,6 @@ jobs: - name: 🐍 Install development dependencies run: | python -m pip install --upgrade pip - pip install pydantic --no-binary pydantic pip install -r requirements-dev.txt - name: 🐍 Install Windows dependencies diff --git a/Dockerfile b/Dockerfile index 975ef9b776..3cdb34dd06 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,8 @@ COPY ./alembic.ini /alembic.ini RUN ./scripts/install-debug.sh -RUN pip3 install --upgrade pip \ - && pip3 install -r /conf/requirements.txt +RUN pip3 install --no-cache-dir --upgrade pip \ + && pip3 install --no-cache-dir -r /conf/requirements.txt ENTRYPOINT ["./scripts/start.sh"] diff --git a/README.md b/README.md index bd17aeae67..5ee6f28cf7 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ Install back-end dependencies ```shell script python -m pip install --upgrade pip -pip install pydantic --no-binary pydantic pip install -r requirements.txt # use requirements-dev.txt if building a single binary with pyinstaller ``` diff --git a/requirements-desktop.txt b/requirements-desktop.txt new file mode 100644 index 0000000000..017ff7c8b3 --- /dev/null +++ b/requirements-desktop.txt @@ -0,0 +1,4 @@ +-r requirements.txt + +# PyQt is used for the systray app of desktop version +PyQt5~=5.15.6 diff --git a/requirements-dev.txt b/requirements-dev.txt index 973973dc76..462d77bb3c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,5 @@ -r requirements-test.txt +-r requirements-desktop.txt # Version of Black should match the versions set in `.github/workflows/main.yml` black~=23.7.0 isort~=5.12.0 diff --git a/requirements.txt b/requirements.txt index 0ddf9db1b4..eefa07d92f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -39,7 +39,6 @@ paramiko~=3.4.1 plyer~=2.0.0 psycopg2-binary==2.9.4 py7zr~=0.20.6 -PyQt5~=5.15.6 python-json-logger~=2.0.7 PyYAML~=5.4.1; python_version <= '3.9' PyYAML~=5.3.1; python_version > '3.9'