From debc9c3e2c3398b3f8c5537524ca4b31fd4db91c Mon Sep 17 00:00:00 2001 From: Robbie Paul Date: Tue, 18 Feb 2020 11:19:39 +0000 Subject: [PATCH] Copy all files when building the test Docker image This is only for the test target and ensures that all the files that could be linted locally are also linted on CI. We need to be mindful of files that get added to the project, if they are secrets or superfluous we should add them to the .dockerignore file. This change doesn't increase the size of the Docker image by much but it will increase build times slightly because of the way that Docker caches layers of a Dockerfile, whenever a file is changed it will need to redo that copy step. --- .dockerignore | 11 +++++++++++ Dockerfile | 18 +++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.dockerignore b/.dockerignore index 86823f183f..d6e1595bb9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,14 @@ /log/ /node_modules/ /tmp/ +/.git/ + +localhost.crt +localhost.key + +.env +.env.local + +.rakeTasks +.byebug_history +.generators diff --git a/Dockerfile b/Dockerfile index 6a25f09adf..c82ad4ae02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -131,19 +131,11 @@ COPY --from=shellcheck / /opt/shellcheck/ ENV PATH /opt/shellcheck/bin:${PATH} # End -# Copy test code (sorted by vague frequency of change for caching) -COPY .prettierignore ${APP_HOME}/.prettierignore -COPY .prettierrc ${APP_HOME}/.prettierrc -COPY .rspec ${APP_HOME}/.rspec -COPY .standard.yml ${APP_HOME}/.standard.yml - -COPY spec ${APP_HOME}/spec -# End - -# Copy files for linting (sorted by vague frequency of change for caching) -COPY docs ${APP_HOME}/docs -COPY *.md ${APP_HOME}/ -COPY azure ${APP_HOME}/azure +# Copy all files +# This is only for the test target and ensures that all the files that could be linted locally are also linted on CI. +# We need to be mindful of files that get added to the project, if they are secrets or superfluous we should add them +# to the .dockerignore file. +COPY . ${APP_HOME}/ # End CMD [ "bundle", "exec", "rake" ]