From 5de5d7b55c6470888d6edb00b80bb9912d3953ac Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Thu, 17 Jun 2021 17:30:41 -0700 Subject: [PATCH] Exclude additional files from Docker images Excludes a few more files that are temporary, build artifacts, test artifacts, runtime artifacts, or not used by the application. This has the consequence of no longer needing to clear compiled assets during build. --- .dockerignore | 8 ++++++++ Dockerfile.production | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index e235b236..7e7192a0 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,10 @@ +.bundle/cache +.git/ +coverage/ +db/*.sqlite3 Dockerfile docker-compose.* +log/ +public/assets/ +public/system/ +tmp/ diff --git a/Dockerfile.production b/Dockerfile.production index ded47832..a0773f74 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -10,7 +10,7 @@ WORKDIR /osem/ RUN export NOKOGIRI_USE_SYSTEM_LIBRARIES=1; bundle install --jobs=3 --retry=3 --without test development # Generate assets -RUN export RAILS_ENV=production; bundle exec rake assets:clobber assets:precompile +RUN export RAILS_ENV=production; bundle exec rake assets:precompile ENV RAILS_ENV=production