Skip to content

chore: add .dockerignore to reduce Docker build context - #201

Merged
DeFiVC merged 2 commits into
ChainLearnOfficial:mainfrom
TheHalalHunter:feat/add-dockerignore
Jul 29, 2026
Merged

chore: add .dockerignore to reduce Docker build context#201
DeFiVC merged 2 commits into
ChainLearnOfficial:mainfrom
TheHalalHunter:feat/add-dockerignore

Conversation

@TheHalalHunter

Copy link
Copy Markdown
Contributor

Summary

Adds a .dockerignore file to prevent unnecessary files from being sent to the Docker daemon during builds.

Problem

Without .dockerignore, the build context includes large/irrelevant directories like node_modules, .git, and tests, making builds significantly slower.

Changes

  • Excludes node_modules (reinstalled fresh via npm ci in the build stage)
  • Excludes .git and .github
  • Excludes tests and src/test
  • Excludes dist (rebuilt in Docker)
  • Excludes .env files, logs, dev config files, editor/OS artifacts

Closes #164

Node.js running as PID 1 does not forward OS signals (SIGTERM, SIGINT)
to child processes and does not reap zombie processes. Without an init
process, SIGTERM sent by Docker/Kubernetes during shutdown may not reach
the app, causing it to be forcibly killed after the stop timeout.

Fix: install tini via apk in the base stage and set it as ENTRYPOINT in
the production stage. Tini runs as PID 1, correctly forwards signals to
the Node.js process, and reaps any zombie child processes.

Closes ChainLearnOfficial#166
Exclude node_modules, .git, tests, dist, and other dev-only
files from the Docker build context to speed up builds and
avoid leaking unnecessary files into the image layers.

Closes ChainLearnOfficial#164
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@Harkinkunmi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@DeFiVC
DeFiVC merged commit 77801a3 into ChainLearnOfficial:main Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No

2 participants