frontend
Caddy 2.8 serves frontend/dist, performs API proxying, and exposes health at /health.
git clone https://github.com/leaflockhq/leaflock.gitcd leaflockcp .env.example .env# Fill JWT_SECRET, SERVER_ENCRYPTION_KEY, POSTGRES_PASSWORD, REDIS_PASSWORD
docker compose up -ddocker compose logs -f backendgit clone https://github.com/leaflockhq/leaflock.gitcd leaflockcp .env.example .env
make up # podman-compose up -dmake logs # follow backend + frontend logsfrontend
Caddy 2.8 serves frontend/dist, performs API proxying, and exposes health at /health.
backend
Go Fiber API with health endpoints at /api/v1/health/* and optional Prometheus metrics when ENABLE_METRICS=true.
postgres
PostgreSQL 15 with pg_isready health checks; data stored in the postgres_data volume.
redis
Redis 7 configured with password auth and persistence inside the redis_data volume.
services:backend: build: ./backend environment: DATABASE_URL: postgres://postgres:{POSTGRES_PASSWORD}@postgres:5432/notes?sslmode=disable REDIS_URL: redis:6379 REDIS_PASSWORD: {REDIS_PASSWORD} JWT_SECRET: {JWT_SECRET} SERVER_ENCRYPTION_KEY: {SERVER_ENCRYPTION_KEY} CORS_ORIGINS: {CORS_ORIGINS} depends_on: postgres: condition: service_healthy redis: condition: service_healthy
frontend: build: ./frontend environment: BACKEND_INTERNAL_URL: http://backend:8080Why Caddy?
/usr/local/bin/docker-entrypoint.sh (shipped with the repo) rewrites upstream addresses based on runtime environment variables.curl http://localhost:3000/health # frontend containercurl http://localhost:8080/api/v1/health/live # backend livenesscurl http://localhost:8080/api/v1/health/ready # backend readiness (checks DB + Redis)docker compose exec postgres pg_isready -U postgres # database healthdocker compose exec redis redis-cli --auth "$REDIS_PASSWORD" pingReady checks map directly to Kubernetes and cloud load balancer probes—keep them healthy before putting LeafLock behind a reverse proxy.
docker compose logs -f backend frontenddocker compose up -d --builddocker compose exec backend shdocker compose down (append -v to drop volumes)LeafLock bundles docker-compose.prod.yml for hardened deployments. Merge it with the base file:
docker compose \-f docker-compose.yml \-f docker-compose.prod.yml \up -dKey changes in the override:
APP_ENV=production and enables metrics on the backend./var/lib/leaflock/* with root-owned directories.JWT_SECRET, SERVER_ENCRYPTION_KEY, POSTGRES_PASSWORD, and REDIS_PASSWORD before first deploy.ENABLE_DEFAULT_ADMIN=false or change the default admin password post-boot.CORS_ORIGINS=https://app.leaflock.example)./operations/backups once created).BACKEND_INTERNAL_URL=http://backend:8080 and the backend container is healthy.config.LoadConfig() to log.Fatalf; check container logs..env matches the Compose command arguments.docker compose logs backend until readiness flips to ready.