Skip to content

Comments

Add production Docker Compose deployment configurations#162

Open
bobbyhyam wants to merge 11 commits intoMng-dev-ai:mainfrom
bobbyhyam:docker-compose-production
Open

Add production Docker Compose deployment configurations#162
bobbyhyam wants to merge 11 commits intoMng-dev-ai:mainfrom
bobbyhyam:docker-compose-production

Conversation

@bobbyhyam
Copy link

@bobbyhyam bobbyhyam commented Feb 5, 2026

Summary

Closes #130

  • Add production Docker Compose configuration with Traefik reverse proxy (docker-compose.traefik.yml) — automatic Let's Encrypt SSL, HTTP→HTTPS redirect, per-service routing (DOMAIN for frontend, api.DOMAIN for API). Requires wildcard DNS.
  • Add GitHub Actions workflows to build and push backend/frontend images to GHCR
  • Add production frontend Dockerfile with nginx and runtime env var injection
  • Add .env.traefik.example with documented configuration
  • Add IMAGE_OWNER env var (defaults to mng-dev-ai) so forks can use their own GHCR images
  • Add Docker Compose deployment docs to README

What changed

  • docker-compose.traefik.yml — pulls pre-built images from GHCR, services behind Traefik with HTTPS, HTTP→HTTPS redirect, and per-service routing. Traefik configured via environment variables. Includes postgres, redis, celery workers, and sandbox setup.
  • frontend/Dockerfile.prod — multi-stage build producing an nginx image; uses placeholder build args (__VITE_API_BASE_URL__, __VITE_WS_URL__) replaced at runtime by docker-entrypoint.sh
  • frontend/docker-entrypoint.sh — sed-replaces placeholders in built JS with actual env vars at container start
  • frontend/nginx.conf — serves the SPA with /health endpoint
  • .github/workflows/build-backend.yml / build-frontend.yml — build multi-arch (amd64/arm64) images on push to main or manual dispatch, push to ghcr.io/${{ github.repository_owner }}/...
  • README.md — added Docker Compose deployment section with Traefik configuration instructions

Test plan

  • docker compose config resolves correctly with default and custom IMAGE_OWNER
  • CI workflows build and push images successfully on a fork
  • docker-compose.traefik.yml — all services come up healthy with fork images, SSL via Let's Encrypt, HTTP→HTTPS redirect verified on live domain
  • Clean deploy from scratch to — full end-to-end test including account creation, provider setup, and agent chat

🤖 Generated with Claude Code

bobbyhyam and others added 7 commits February 5, 2026 19:44
- docker-compose.traefik.yml: Full production with Traefik reverse proxy, auto-SSL via Let's Encrypt, isolated networks
- docker-compose.simple.yml: Simple HTTP deployment with direct port access
- frontend/Dockerfile.prod: Multi-stage build with nginx serving static assets
- frontend/nginx.conf: SPA routing, gzip compression, caching, security headers
- .env.traefik.example and .env.simple.example: Example environment files

Key production features:
- PostgreSQL 17-alpine with 600 max connections
- Redis 7-alpine with AOF persistence
- Named volumes instead of mounted code directories
- Resource limits and health checks with start_period
- Isolated networks for security

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Enable ping and add --ping flag to Traefik healthcheck
- Set providers.docker.network to avoid arbitrary network selection for multi-network containers
- Fix frontend healthcheck to use 127.0.0.1 instead of localhost (IPv6 mismatch on Alpine)
- Add explicit network name to claudex-proxy to avoid project-name prefix issues

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add GitHub Actions workflows for building backend and frontend images
- Replace hardcoded image references with ${IMAGE_OWNER:-mng-dev-ai} in
  both compose files so forks can use their own GHCR images
- Update frontend Dockerfile.prod to use placeholder-based build args
  with runtime env var injection via docker-entrypoint.sh
- Add IMAGE_OWNER to .env example files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Upgrade Traefik v3.0 → v3.4 to fix incompatibility with Docker Engine
29.x (requires API v1.44+). Add ALLOWED_ORIGINS for the cross-origin
traefik setup where frontend and API are on different subdomains.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v3.4 still uses Docker API v1.24; the auto-negotiation fix landed in
v3.6.1. Verified on cldx-test.bobbyhyam.com with Docker Engine 29.2.1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bobbyhyam bobbyhyam marked this pull request as draft February 8, 2026 13:26
bobbyhyam and others added 4 commits February 8, 2026 15:22
Environment variables are the preferred configuration method for Traefik
in Docker Compose, avoiding shell escaping issues with CLI args.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drop docker-compose.simple.yml from the repo and rewrite the
deployment section to clarify the two supported modes (localhost dev
vs internet-facing server) and the current requirement for public
domain with wildcard DNS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
No longer needed after dropping the simple compose configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bobbyhyam bobbyhyam marked this pull request as ready for review February 8, 2026 16:11
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.

Support for Docker Compose production deployment

1 participant