services:
  redis:
    image: redis:8.2.2-alpine
    volumes:
      - redis:/data
    restart: unless-stopped
    environment:
      REDIS_PASSWORD: ${REDIS_PASSWORD}
    networks:
      - app
    healthcheck:
      test: ["CMD", "redis-cli", "--pass", "${REDIS_PASSWORD}", "ping"]
      interval: 10s
      retries: 5
      start_period: 30s
      timeout: 10s
  web:
    depends_on:
      redis:
        condition: service_healthy
        restart: true
    environment:
      REDIS_URL: redis://:${REDIS_PASSWORD}@redis/
volumes:
  redis:
networks:
  app:
    external: true
  wan:
    external: true
