Skip to content

Add Docker containerization of unreal-index service#20

Open
Joxx0r wants to merge 1 commit intomainfrom
docker-image
Open

Add Docker containerization of unreal-index service#20
Joxx0r wants to merge 1 commit intomainfrom
docker-image

Conversation

@Joxx0r
Copy link
Collaborator

@Joxx0r Joxx0r commented Feb 8, 2026

Summary

  • Replace manual WSL setup (Node 22, Go, Zoekt build, screen) with docker compose up
  • Multi-stage Dockerfile: Go builder (Zoekt binaries) → Node builder (native modules) → slim runtime (~250MB)
  • Named Docker volumes for SQLite, mirror, and Zoekt index (ext4, survives docker compose down)

Changes

New files (8)

File Purpose
Dockerfile 3-stage build: Go (Zoekt), Node (native deps), slim runtime
docker-compose.yml Production: named volumes, 4GB mem limit, healthcheck, graceful shutdown
docker-compose.dev.yml Dev override: source mounts, --watch, Zoekt port exposed
config.docker.json Container paths (/data/), host: 0.0.0.0, empty projects
docker-entrypoint.sh Creates data dirs, copies default config, exec node for signal handling
.dockerignore Excludes tests, artifacts, git history
test-docker-perf.mjs 6-phase Docker perf test (startup, core, restart, ingest-under-load, memory, volume I/O)
DOCKER.md Setup guide, architecture diagram, troubleshooting, Docker-vs-WSL comparison

Modified files (2)

File Change
src/service/index.js UNREAL_INDEX_CONFIG env var override + relaxed project validation (warning instead of error for empty projects)
start-service.sh --docker flag: runs docker compose up -d and polls health for 30s

Design decisions

Concern Solution
SQLite perf Named volumes (ext4 on Docker VM), NOT bind mounts from Windows
Data persistence 3 named volumes survive down. Only down -v destroys them
Memory 4GB container limit (3GB Node heap + 1GB Zoekt/OS)
Graceful shutdown stop_grace_period: 30s + exec entrypoint for direct SIGTERM
Networking Port 3847 mapped to host. Zoekt 6070 internal only

Test plan

  • docker compose build completes without errors
  • docker compose up -d starts, curl localhost:3847/health responds within 30s
  • Windows watcher can POST to localhost:3847/internal/ingest and data persists
  • docker compose down && docker compose up -d retains all indexed data
  • node test-docker-perf.mjs passes all 6 phases
  • docker compose -f docker-compose.yml -f docker-compose.dev.yml up works for dev

🤖 Generated with Claude Code

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

@claude Please review this PR. Focus on:

  • Code quality and potential bugs
  • Security issues
  • Test coverage
  • Documentation completeness

Use the opus model for thorough analysis.

@Joxx0r
Copy link
Collaborator Author

Joxx0r commented Feb 11, 2026

@claude could you review this?

Replace manual WSL setup (Node 22, Go, Zoekt build, screen) with
`docker compose up`. Multi-stage Dockerfile builds Zoekt from Go
and compiles native Node modules, producing a ~250MB runtime image.

- Dockerfile: 3-stage build (Go builder, Node builder, slim runtime)
- docker-compose.yml: named volumes, 4GB mem limit, health check
- docker-compose.dev.yml: source mounts with --watch for development
- config.docker.json: container paths (/data/), host 0.0.0.0
- docker-entrypoint.sh: data dir setup, config fallback, exec node
- index.js: env-var config path, relaxed project validation for Docker
- start-service.sh: --docker flag with health polling
- test-docker-perf.mjs: 6-phase Docker perf test suite
- DOCKER.md: setup guide, architecture, troubleshooting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Joxx0r Joxx0r changed the title Add Docker support for zero-dependency setup Add Docker containerization of unreal-index service Feb 11, 2026
@Joxx0r
Copy link
Collaborator Author

Joxx0r commented Feb 11, 2026

@claude could you review this

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