deer-flow/.dockerignore
Aari 62ffcff45b
fix(docker): keep runtime data out of the build context (#4853)
* fix(docker): keep runtime data out of the build context

backend/Dockerfile copies the backend tree wholesale, and .dockerignore did
not exclude the directories a running DeerFlow writes: DEER_FLOW_HOME
(backend/.deer-flow by default) and the local sandbox workspace root
(backend/sandbox).

Two consequences. Building on a host that has run DeerFlow bakes that state
into the image, including .jwt_secret and the sqlite user database. And once
the Gateway container has created directories owned by root, the build client
can no longer read them and the build fails outright:

  target gateway: failed to solve: error from sender:
  open .../.deer-flow/users/<uuid>/integrations/lark-cli: permission denied

Neither directory has tracked content, so excluding them costs the build
nothing. The new test pins both that the runtime paths are excluded and that
real build inputs still are not.

* fix(docker): exclude nested env files from builds
2026-08-18 23:14:17 +08:00

87 lines
1.4 KiB
Plaintext

**/.env
Dockerfile
.dockerignore
.git
.gitignore
docker/
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
.venv/
# Web
node_modules
npm-debug.log
.next
# IDE
.idea/
.vscode/
*.swp
*.swo
# OS
.DS_Store
Thumbs.db
# Project specific
conf.yaml
web/
docs/
examples/
assets/
tests/
*.log
# Exclude directories not needed in Docker context
# Frontend build only needs frontend/
# Backend build only needs backend/
scripts/
logs/
docker/
skills/
frontend/.next
frontend/node_modules
backend/.venv
backend/htmlcov
backend/.coverage
# Runtime data written by a running DeerFlow, not build inputs. backend/Dockerfile
# does `COPY backend ./backend`, so leaving these in the context both bakes the
# sqlite database, per-user uploads and the JWT secret into the image and breaks
# the build outright once the app has created directories owned by the container's
# root that the build client cannot read.
**/.deer-flow/
backend/sandbox/
*.md
!README.md
!frontend/README.md
!backend/README.md
# Extension manager snapshots must enter the backend builder intact. A Python
# package may require README metadata, native modules, or package assets that
# the general image-context exclusions above intentionally omit elsewhere.
!backend/extensions/
!backend/extensions/sources/
!backend/extensions/sources/**