# Warning : 사이트 이름을 정하는 것을 잊지 마세요!
services:
  # 웹 프런트엔드
  traefik:
    image: traefik:v3.6
    container_name: front
    restart: unless-stopped
    command:
      - "--providers.docker=true"
      - "--entrypoints.http.address=:80"
    ports:
      - 80:80
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    labels:
      - "traefik.enable=true"
  # InfluxDB 데이터베이스
  influxdb:
    image: influxdb:2.8.0
    container_name: influxdb
    user: "1000:1000"
    environment:
      DOCKER_INFLUXDB_INIT_MODE:
      DOCKER_INFLUXDB_INIT_USERNAME:
      DOCKER_INFLUXDB_INIT_PASSWORD:
      DOCKER_INFLUXDB_INIT_ORG: 
      DOCKER_INFLUXDB_INIT_BUCKET: 
      DOCKER_INFLUXDB_INIT_RETENTION:
      DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: 
    volumes:
      - ./influxdb2/data:/var/lib/influxdb2
      - ./influxdb2/config:/etc/influxdb2
    restart: unless-stopped
    labels:
      - "traefik.http.routers.influxdb.rule=Host(`influx.test`)" # 사이트 이름
      - "traefik.http.services.influxdb.loadbalancer.server.port=8086"    
  # 그래픽 렌더링 서비스
  grafana:
    image: grafana/grafana:main
    container_name: grafana
    user: "1000:1000" 
    restart: always
    depends_on:
      - influxdb
    environment:
      - GF_SECURITY_ADMIN_USER
      - GF_SECURITY_ADMIN_PASSWORD
    ports:
      - 3000:3000
    volumes:
      - ./grafana/datas:/var/lib/grafana:rw
    labels:
      - "traefik.http.routers.grafana.rule=Host(`grafana.test`)" # 사이트 이름
      - "traefik.http.services.grafana.loadbalancer.server.port=3000"