# version: '3.8'

services:

  garmindb-mtb-dashboard:
    image: garmindb-mtb-dashboard
    container_name: garmindb-mtb-dashboard
    restart: always
    environment:
      - FLASK_APP:garmindb-mtb-dashboard
      # - PUID=1000
      # - PGID=1000
      - TZ=${TZ:-Europe/Berlin}
    build: .
    dns:
      - "9.9.9.9"
    volumes:
      - ./GarminDB:/root/.GarminDb
      - ./HealthData:/root/HealthData
    networks:
      - db_network
      - proxy

  nginx:
    container_name: nginx
    restart: always
    image: "nginx:latest"
    ports:
      - "5085:5085"
    volumes:
      - ./nginx:/etc/nginx/conf.d
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=${TZ:-Europe/Berlin}
    dns:
      - "9.9.9.9"
    labels:
      - "traefik.enable=true" 
      - "traefik.http.services.garmindb-mtb-dashboard.loadbalancer.server.port=5085"
      - "traefik.http.routers.garmindb-mtb-dashboard.rule=Host(`mtb-dashboard.spring.private`)"
      - "traefik.http.routers.garmindb-mtb-dashboard.entrypoints=web"
    networks:
      - proxy
    depends_on: 
      - garmindb-mtb-dashboard
      
networks:
  db_network:
    driver: bridge
  proxy:
    external: true
 
