Skip to content

chore(docker): optimise build performance and pin image versions#41

Open
jmiguelv wants to merge 1 commit into
mainfrom
chore/optimise-docker-builds
Open

chore(docker): optimise build performance and pin image versions#41
jmiguelv wants to merge 1 commit into
mainfrom
chore/optimise-docker-builds

Conversation

@jmiguelv
Copy link
Copy Markdown
Owner

@jmiguelv jmiguelv commented May 12, 2026

Summary

  • .dockerignore files added to backend/ and harvester/ — reduces build context from ~1.1 GB to <1 MB by excluding .venv, __pycache__, tests/, data/
  • Multi-stage Dockerfiles for backend and harvester — uv is used only in the builder stage; runtime image contains only the venv and source
  • BuildKit cache mounts (--mount=type=cache,target=/root/.cache/uv) — source-only rebuilds skip package re-downloads entirely
  • Pinned image tags in docker-compose.ymlqdrant:v1.18.0, redis:7-alpine, redisinsight:3.4.2, phoenix:15.6.0
  • README updated to remove uv run prefix from all docker compose run examples

Test plan

  • docker compose build --no-cache succeeds for backend and harvester
  • Touch a source file, re-run docker compose build backend — only the COPY . . layer re-executes (seconds, not minutes)
  • docker compose up -d — all services healthy, backend reachable at http://localhost:8000
  • docker compose run --rm harvester python main.py --all runs without errors

🤖 Generated with Claude Code

- Add .dockerignore to backend and harvester to reduce build context
  from ~1.1 GB to <1 MB by excluding .venv, __pycache__, tests, data
- Convert backend and harvester to multi-stage Dockerfiles; uv is used
  only in the builder stage and the venv is copied to a clean runtime
- Add BuildKit cache mounts for uv to persist the package cache across
  rebuilds, making dependency-unchanged builds significantly faster
- Pin all external image tags (qdrant, redis, redis-insight, phoenix)
  to avoid unnecessary registry re-pulls on every compose invocation
- Update README docker compose run examples to drop the uv run prefix

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant