From b6290d22bd1962ea6351752380833b6339ef070e Mon Sep 17 00:00:00 2001 From: Adam Leskis Date: Thu, 11 Jul 2024 22:01:11 +0100 Subject: [PATCH 1/3] Add dockerignore to clean up final image Currently, the final base image has a bunch of things it doesn't need, including the entire .git folder. This commit adds a .dockerignore to keep the things we don't need out of the final image. --- .dockerignore | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..4fbac8c5b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,22 @@ +.git +.gitattributes +.github +.gitignore + +.env.example + +.circleci +.clabot + +*.md +LICENSE +COPYRIGHT + +.vscode + +Dockerfile +.dockerignore + +*.yml + +spec From 4db06b5337e8529b046d327cc4c3972e7f06a05d Mon Sep 17 00:00:00 2001 From: Adrian Lansdown Date: Thu, 26 Feb 2026 18:06:15 +0000 Subject: [PATCH 2/3] Expand .dockerignore to ignore additional files Reorganise and expand .dockerignore entries to exclude CI, Docker config, editor/devtooling files, docs, environment samples, tests, and runtime directories. Reduces Docker build context size and prevents including unnecessary or sensitive files (e.g. .env.example, log, tmp, storage, .devcontainer, Dockerfile, docker-compose files, .DS_Store, rubocop config, docs, spec) --- .dockerignore | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.dockerignore b/.dockerignore index 4fbac8c5b..e063dc461 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,22 +1,46 @@ +# Version control .git .gitattributes .github .gitignore -.env.example - +# CI/CD .circleci .clabot -*.md -LICENSE -COPYRIGHT +# Docker (no need to include itself) +Dockerfile +.dockerignore +docker-compose.yml +docker-compose.override.yml.example +# Editor / IDE .vscode +.devcontainer -Dockerfile -.dockerignore +# Dev tooling +.rspec +.pryrc +.ruby-lsp +.tool-versions +.DS_Store +.rubocop.yml +.rubocop_todo.yml +.rubocop-https--* -*.yml +# Documentation +*.md +LICENSE +COPYRIGHT +docs +# Environment +.env.example + +# Tests spec + +# Runtime dirs (recreated at runtime) +log +tmp +storage From 768880cfd5d1ce109fa60b864b48b9b892c629a6 Mon Sep 17 00:00:00 2001 From: Adrian Lansdown Date: Thu, 26 Feb 2026 18:25:50 +0000 Subject: [PATCH 3/3] Keep .tool-versions in Docker build context. The Dockerfile copies .tool-versions during the builder stage, so excluding it in .dockerignore causes the image build to fail with a missing file error. This keeps the ignore list lean while preserving a successful app image build. Made-with: Cursor --- .dockerignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index e063dc461..6833f519d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -22,7 +22,6 @@ docker-compose.override.yml.example .rspec .pryrc .ruby-lsp -.tool-versions .DS_Store .rubocop.yml .rubocop_todo.yml