diff --git a/.dockerignore b/.dockerignore index 7f886c49..7b5d0f67 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,7 +2,6 @@ .bash_history # Git -.git .github .gitignore diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 4433d13a..76c5dc6d 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -20,6 +20,7 @@ USER ${USERNAME} ADD --chown=${USERNAME}:${GROUPNAME} . ${USER_DIR}/ + # Install dependencies. Note: Base image already contains several of the # heaviest ones. RUN pip3 install -r requirements.txt -r deploy_requirements.txt @@ -31,6 +32,9 @@ RUN pip3 install . RUN python3 setup.py build_sphinx RUN pip3 install . +# Remove .git after building +RUN rm -rf ${USER_DIR}/.git + # gunicorn.conf is set up so that one can tune gunicorn settings when # running the container by setting environment an variable # GUNICORN_[setting], where setting is any of the parameters in this