services:
  web:
    image: ${WEB_IMAGE:-fast-website:local}
    build:
      context: .
      dockerfile: Dockerfile
      args:
        # Build-time toggle for service worker registration in the generated static HTML.
        PUBLIC_ENABLE_SW: ${PUBLIC_ENABLE_SW:-true}
        PUBLIC_ENABLE_NAV_HOVER_LINE: ${PUBLIC_ENABLE_NAV_HOVER_LINE:-true}
        PUBLIC_ASSET_VERSION: ${PUBLIC_ASSET_VERSION:-}
        # Public, build-time config baked into the HTML.
        PUBLIC_SITE_URL: ${PUBLIC_SITE_URL:-}
        PUBLIC_UMAMI_SCRIPT_URL: ${PUBLIC_UMAMI_SCRIPT_URL:-}
        PUBLIC_UMAMI_WEBSITE_ID: ${PUBLIC_UMAMI_WEBSITE_ID:-}
    ports:
      - "8080:80"
    networks:
      - fast-website-network
    

  redis:
    image: redis:7-alpine
    ports:
      # Use 6380 to avoid colliding with any locally installed Redis on 6379.
      - "6380:6379"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 20
    networks:
      - fast-website-network

networks:
  fast-website-network:
    driver: bridge
