From fb956e330ff6a0af57484e54d8340bec77688e5b Mon Sep 17 00:00:00 2001 From: Quintin Date: Fri, 1 Aug 2025 12:25:37 -0700 Subject: [PATCH] Include .git for revision SHA at docker build time --- .dockerignore | 1 - docker/production/Dockerfile | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) 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