version: '3.8' services: api: build: context: . dockerfile: Dockerfile env_file: - .env ports: - "${API_PORT:-5000}:5000" depends_on: db: condition: service_healthy redis: condition: service_healthy networks: - authy2-network restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:5000/api/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s db: image: postgres:16-alpine environment: - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - POSTGRES_DB=${POSTGRES_DB} volumes: - postgres_data:/var/lib/postgresql/data networks: - authy2-network restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 10s timeout: 5s retries: 5 start_period: 30s ports: - "5432:5432" redis: image: redis:7-alpine command: redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru volumes: - redis_data:/data networks: - authy2-network restart: unless-stopped healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 ports: - "6379:6379" nginx: image: nginx:1.27-alpine volumes: - ./docker/nginx.conf:/etc/nginx/nginx.conf:ro ports: - "${HTTP_PORT:-80}:80" - "${HTTPS_PORT:-443}:443" depends_on: - api networks: - authy2-network restart: unless-stopped healthcheck: test: ["CMD", "nginx", "-t"] interval: 30s timeout: 10s retries: 3 zerotier-reconciler: build: context: . dockerfile: Dockerfile.job env_file: - .env environment: - JOB_NAME=zerotier_reconciliation - JOB_INTERVAL_SECONDS=${ZEROTIER_RECONCILE_INTERVAL:-120} depends_on: db: condition: service_healthy redis: condition: service_healthy networks: - authy2-network restart: unless-stopped mfa-compliance: build: context: . dockerfile: Dockerfile.job env_file: - .env environment: - JOB_NAME=mfa_compliance - JOB_INTERVAL_SECONDS=${MFA_COMPLIANCE_INTERVAL:-3600} depends_on: db: condition: service_healthy redis: condition: service_healthy networks: - authy2-network restart: unless-stopped networks: authy2-network: driver: bridge volumes: postgres_data: redis_data: