services:
  redis:
    image: redis:7-alpine
    container_name: hermes-redis
    restart: unless-stopped
    networks:
      - hermes-net
    ports:
      - "6379:6379"
    command: redis-server --save ""

  hermes:
    build: .
    container_name: hermes-mcp
    restart: unless-stopped
    env_file: .env
    environment:
      - MYSQL_HOST=mysql
      - REDIS_URL=redis://redis:6379
    depends_on:
      - redis
    volumes:
      - /home/garfield/obsidian/vaults:/vaults
    extra_hosts:
      - "host.docker.internal:host-gateway"
    ports:
      - "${PORT:-3456}:${PORT:-3456}"
    networks:
      - hermes-net
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.hermes.rule=Host(`hermes.fetcherpay.com`)"
      - "traefik.http.routers.hermes.entrypoints=websecure"
      - "traefik.http.routers.hermes.tls.certresolver=letsencrypt"
      - "traefik.http.services.hermes.loadbalancer.server.port=3456"

networks:
  hermes-net:
    driver: bridge
