aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2021-01-09 17:24:07 -0800
committerGravatar MarkKoz <[email protected]>2021-01-09 17:24:07 -0800
commitaba2caaa40832bcef3958214f0d88bd841134f2e (patch)
tree4b1c5531d5d8e6043cc0c07d21131942929e80b9 /Dockerfile
parentDocument how to install additional packages (diff)
Prevent setting GIT_SHA from invalidating the Docker layer cache
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Dockerfile b/Dockerfile
index d9c67fc..eefb795 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -35,13 +35,11 @@ RUN chmod +x /usr/sbin/nsjail
FROM base as venv
ARG DEV
-ARG git_sha="development"
ENV PIP_NO_CACHE_DIR=false \
PIPENV_DONT_USE_PYENV=1 \
PIPENV_HIDE_EMOJIS=1 \
PIPENV_NOSPIN=1 \
- GIT_SHA=$git_sha \
PYTHONUSERBASE=/snekbox/user_base
COPY Pipfile Pipfile.lock /snekbox/
@@ -55,6 +53,7 @@ RUN if [ -n "${DEV}" ]; \
fi
# At the end to avoid re-installing dependencies when only a config changes.
+# It's in the venv image because the final image is not used during development.
COPY config/ /snekbox/config
FROM venv
@@ -64,3 +63,7 @@ CMD ["-c", "config/gunicorn.conf.py", "snekbox.api.app"]
COPY . /snekbox
WORKDIR /snekbox
+
+# At the end to prevent it from invalidating the layer cache.
+ARG git_sha="development"
+ENV GIT_SHA=$git_sha