From edaaaf3017cf74343d10bbf59fb4b366ecdae8e3 Mon Sep 17 00:00:00 2001 From: jmeridth Date: Sat, 31 May 2025 16:13:21 -0500 Subject: [PATCH] fix: docker image content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - [x] add .dockerignore to ensure non application files/test files don't get into the container image Tested locally with the following commands: ```bash ➜ docker build . --tag test:1 ➜ docker run -it --rm --name debug --entrypoint /bin/bash test:1 ## inside container root@3624b051f2c8:/action/workspace# ls -lah total 44K drwxr-xr-x 1 root root 4.0K May 27 13:11 . drwxr-xr-x 1 root root 4.0K May 27 13:11 .. -rw-r--r-- 1 root root 1.8K Jan 7 10:26 auth.py -rw-r--r-- 1 root root 4.4K Mar 30 23:25 env.py -rw-r--r-- 1 root root 68 Apr 4 04:04 requirements.txt -rwxr-xr-x 1 root root 14K May 27 12:11 stale_repos.py ``` Signed-off-by: jmeridth --- .dockerignore | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1f934fb --- /dev/null +++ b/.dockerignore @@ -0,0 +1,36 @@ +# Application specific files +test_*.py + +# Python +*.pyc +__pycache__/ +*.pyo +*.pyd + +# Common +*.md +docker-compose.yml +Dockerfile* +.env* +Makefile + +# Logs +logs +*.log + +# IDEs +.vscode/ +.idea/ + +# Dependency directories +node_modules/ +.venv/ + +## Cache directories +.parcel-cache + +# git +.git +.gitattributes +.gitignore +.github/