services:
  reverse-proxy:
    image: traefik:v3.1
    command:
      - "--providers.docker"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    ports:
      - 127.0.0.1:36694:80
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - web

  newsanalyze-service:
    image: ghcr.io/hpware/news-analyze:master
    networks:
      - web
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.newsanalyze.rule=Host(`news.yuanhau.com`)"
      - "traefik.http.services.newsanalyze.loadbalancer.server.port=3000"
      - "com.centurylinklabs.watchtower.enable=true"
    restart: unless-stopped
    env_file:
      - path: ./.env
        required: true
    deploy:
      mode: replicated
      replicas: 2

networks:
  web:
