From 8d44b67e6e97f7a5ae9ffbdaa2b6ce0626638a4e Mon Sep 17 00:00:00 2001 From: Paul Sanders Date: Sun, 10 Jul 2022 22:00:36 -0400 Subject: [PATCH 1/2] Reduce docker image size --- .dockerignore | 16 +++++++++++++++- Dockerfile.app | 5 ++--- Dockerfile.worker | 5 ++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.dockerignore b/.dockerignore index f02cf8797..26568d1a7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,9 +3,23 @@ .DS_Store .git .mypy_cache +.github +.pytest_cache +.python-version -venv/ clients/admin-ui/node_modules clients/admin-ui/.next clients/privacy-center/node_modules clients/privacy-center/.next + +.venv +venv/ +env/ + +__pycache__/ +**.*.pyc +**.*.pyo +**.*.pyd + +Dockerfile +docker-compose* diff --git a/Dockerfile.app b/Dockerfile.app index 0f89aed15..27b2936d4 100644 --- a/Dockerfile.app +++ b/Dockerfile.app @@ -46,9 +46,8 @@ RUN if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then apt-get -y --no-install-r # Update pip and install requirements COPY requirements.txt dev-requirements.txt mssql-requirements.txt ./ RUN pip install -U pip \ - && pip install -r requirements.txt -r dev-requirements.txt - -RUN if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then pip install -U pip -r mssql-requirements.txt ; fi + && pip --no-cache-dir install -r requirements.txt -r dev-requirements.txt \ + && if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then pip --no-cache-dir install -r mssql-requirements.txt ; fi # Copy in the application files and install it locally COPY . /fidesops diff --git a/Dockerfile.worker b/Dockerfile.worker index d1cc92611..5e85312b8 100644 --- a/Dockerfile.worker +++ b/Dockerfile.worker @@ -38,9 +38,8 @@ RUN if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then apt-get -y install \ # Update pip and install requirements COPY requirements.txt dev-requirements.txt mssql-requirements.txt ./ RUN pip install -U pip \ - && pip install -r requirements.txt -r dev-requirements.txt - -RUN if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then pip install -U pip -r mssql-requirements.txt ; fi + && pip --no-cache-dir install -r requirements.txt -r dev-requirements.txt \ + && if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then pip --no-cache-dir install -r mssql-requirements.txt ; fi # Copy in the application files and install it locally From 39b4303e4a195ce70a87c8b73ba95f8c21b56b93 Mon Sep 17 00:00:00 2001 From: Paul Sanders Date: Sun, 10 Jul 2022 22:40:41 -0400 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7502c7ba3..bbef6516f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ The types of changes are: ### Developer Experience * Replace user authentication routes with fideslib routes [#811](https://github.com/ethyca/fidesops/pull/811) +* Reduce docker image size [846](https://github.com/ethyca/fidesops/pull/846) ### Fixed * Resolve issue with MyPy seeing files in fidesops as missing imports [#719](https://github.com/ethyca/fidesops/pull/719)