The example server. Reads environment from apps/example/.env and overrides connection URLs to use Docker service names.
The host port is configurable via the PORT environment variable (defaults to 3000).
website
The marketing website (Next.js). Host port configurable via WEBSITE_PORT (defaults to 4000).
Quick Start
Running Individual Services
Data Persistence
The pgdata named volume persists PostgreSQL data across container restarts:
Redis data is not persisted (no volume mount). When the Redis container is removed, all client balances are lost. For production, add a volume or use a managed Redis service.
Connecting Locally
When running your server outside Docker but using Docker for infrastructure:
Note: Use localhost and the host ports (6379, 5433) when connecting from outside Docker.
# 1. Create .env file with Stripe keys
cp apps/example/.env.example apps/example/.env
# Edit apps/example/.env with your Stripe test keys
# 2. Start all services
docker compose up -d
# 3. Verify
curl http://localhost:3000/api/health
# => {"status":"ok"}
curl -i http://localhost:3000/api/joke
# => HTTP/1.1 402 Payment Required
# Just Redis (for local development)
docker compose up -d redis
# Redis + PostgreSQL
docker compose up -d redis postgres
# Everything
docker compose up -d
volumes:
pgdata:
# Start just the databases
docker compose up -d redis postgres
# In your .env
REDIS_URL=redis://localhost:6379
DATABASE_URL=postgresql://stripe402:stripe402@localhost:5433/stripe402
# Stop containers (preserves volumes)
docker compose down
# Stop and remove volumes (deletes all data)
docker compose down -v