aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2021-03-13 20:15:42 +0000
committerGravatar Joe Banks <[email protected]>2021-03-13 20:15:52 +0000
commit1c94d02b6d08c4b1df6e714d3571312b1376171f (patch)
tree00c5bfb9988ca40f65241e88c8fa4221476a3eff /Dockerfile
parentmaster => main (diff)
Dockerfile optimisations
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile17
1 files changed, 11 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index 328984ad..0db0b0ef 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,14 +1,10 @@
FROM python:3.8-slim
-# Set SHA build argument
-ARG git_sha="development"
-
# Set pip to have cleaner logs and no saved cache
ENV PIP_NO_CACHE_DIR=false \
PIPENV_HIDE_EMOJIS=1 \
PIPENV_IGNORE_VIRTUALENVS=1 \
- PIPENV_NOSPIN=1 \
- GIT_SHA=$git_sha
+ PIPENV_NOSPIN=1
# Install git to be able to dowload git dependencies in the Pipfile
RUN apt-get -y update \
@@ -21,11 +17,20 @@ RUN pip install -U pipenv
# Copy the project files into working directory
WORKDIR /bot
-COPY . .
+
+# Copy dependency files
+COPY Pipfile Pipfile.lock ./
# Install project dependencies
RUN pipenv install --deploy --system
+# Copy project code
+COPY . .
+
+# Set Git SHA enviroment variable
+ARG git_sha="development"
+ENV GIT_SHA=$git_sha
+
ENTRYPOINT ["python"]
CMD ["-m", "bot"]