services: happy-server: image: masfrank/happy-server:latest container_name: happy-server restart: unless-stopped volumes: - happy-data:/data ports: - "127.0.0.1:3005:3005" environment: NODE_ENV: production TZ: ${TZ:-UTC} PORT: 3005 DATABASE_URL: ${DATABASE_URL} REDIS_URL: ${REDIS_URL} HANDY_MASTER_SECRET: ${HANDY_MASTER_SECRET} depends_on: postgres: condition: service_healthy redis: condition: service_healthy healthcheck: test: ["CMD-SHELL", "wget -q -O /dev/null http://localhost:3005/health || exit 1"] interval: 30s timeout: 10s retries: 3 start_period: 20s postgres: image: postgres:15-alpine container_name: postgres restart: unless-stopped environment: POSTGRES_DB: ${POSTGRES_DB:-happy-server} POSTGRES_USER: ${POSTGRES_USER:-happy} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} TZ: ${TZ:-UTC} volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-happy} -d ${POSTGRES_DB:-happy-server}"] interval: 10s timeout: 5s retries: 10 start_period: 10s # Uncomment to expose postgres to host for debugging: # ports: # - "127.0.0.1:5432:5432" redis: image: redis:7-alpine container_name: redis restart: unless-stopped volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 3s retries: 5 # Uncomment to expose redis to host for debugging: # ports: # - "127.0.0.1:6379:6379" volumes: happy_data: postgres_data: redis_data: