Skip to content

feat: Docker Compose setup with Caddy reverse proxy#41

Open
gabiudrescu wants to merge 3 commits intoJayantDevkar:mainfrom
productowner-ro:feat/docker-setup
Open

feat: Docker Compose setup with Caddy reverse proxy#41
gabiudrescu wants to merge 3 commits intoJayantDevkar:mainfrom
productowner-ro:feat/docker-setup

Conversation

@gabiudrescu
Copy link

Hey there! 👋

First off, great project. I just discovered Claude Code Karma and I love what you've built here. Thanks for putting this together and maintaining it.

I wanted to make it easier to get started without installing Python and Node locally, so I put together a Docker Compose setup. The idea is a single docker compose up (or make up) and everything runs behind a Caddy reverse proxy on port 8080.

What's in this PR:

  • Three containers: Caddy (reverse proxy), FastAPI API, SvelteKit frontend
  • ~/.claude is mounted read-only by default so nothing gets modified
  • A Makefile for common operations (make up, make dev, make health, etc.)
  • A GitHub Actions workflow that builds and pushes images to GHCR on merge to main
  • A small change to frontend/src/lib/config.ts to handle both browser and SSR API URLs (the existing local dev workflow is unchanged)

I tested this locally and it works well. Dashboard loads, API returns projects, health checks pass. I might be missing edge cases though, so any feedback is welcome.

Known limitation: live sessions don't show in Docker.

The live session tracker hook writes state files to ~/.claude_karma/live-sessions/ on the host. In Docker, the API container uses a named volume for /root/.claude_karma (because it also writes the SQLite metadata database there), so it doesn't see the host's live session files. Mounting ~/.claude_karma directly from the host would create SQLite locking conflicts between the container and any native API instance.

A longer-term solution might be replacing SQLite with PostgreSQL or MySQL as a separate container. That would cleanly separate the database from the filesystem, allow the host's ~/.claude_karma/live-sessions/ to be mounted read-only without locking issues, and open the door for multi-instance setups down the road. Just a thought, not sure if that aligns with the project's goals.

No rush on reviewing this. Happy to adjust anything. 🙏

Gabi Udrescu
productowner.ro

gabiudrescu and others added 3 commits March 2, 2026 17:47
Three-container architecture behind Caddy (port 8080):
- Caddy reverse proxy: /api/* → FastAPI, /* → SvelteKit
- API: python:3.11-slim with healthcheck
- Frontend: multi-stage node:22-slim build

Includes dev override (HMR), read-write override, Makefile for
orchestration, GitHub Actions workflow for GHCR image publishing,
and dual browser/SSR API URL resolution in config.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Components like AgentList, SkillViewer, ToolList use new URL(API_BASE + path)
which requires an absolute URL. The relative /api path caused
"Failed to construct URL: Invalid URL" errors in the browser.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gabiudrescu
Copy link
Author

@JayantDevkar in retrospective, I should have started with an issue first, not with a PR, but I hoped code will speak on my behalf :D

I was monitoring the repo in the past couple of days, since this has sparked my interest, so I was wondering if you had any chance to review this. curious how do you feel about this contribution and how do you see things moving forward.

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