fix: optimize Docker image size — .dockerignore + selective COPY in runtime

This commit is contained in:
2026-03-25 03:59:16 -07:00
parent e203f7a235
commit 1b190098ec
2 changed files with 29 additions and 13 deletions
+25 -12
View File
@@ -1,12 +1,25 @@
src/frontend/node_modules
src/frontend/build
src/frontend/coverage
src/frontend/test-results
src/frontend/playwright-report
src/frontend/.dspy_cache
**/.DS_Store
**/__pycache__
**/*.pyc
**/.pytest_cache
**/.venv
**/.env
.git
.github
.vscode
.cursor
.claude
__pycache__
*.pyc
*.pyo
.venv
.mypy_cache
.ruff_cache
.pytest_cache
node_modules
tests
docker
docs
*.md
!README.md
.env*
.DS_Store
*.egg-info
dist
build
*.tar.gz
*.whl
+4 -1
View File
@@ -71,7 +71,10 @@ ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PORT=3006
COPY --chown=hanzo:hanzo . .
# Copy only what's needed at runtime (not .git, tests, docs, docker/, etc.)
COPY --chown=hanzo:hanzo ./src /app/src
COPY --chown=hanzo:hanzo ./pyproject.toml /app/pyproject.toml
COPY --chown=hanzo:hanzo ./README.md /app/README.md
RUN mkdir -p /app/data /app/logs && chown -R hanzo:hanzo /app/data /app/logs