services:

  dash:
    restart: unless-stopped
    image: mauricenino/dashdot:latest
    privileged: true
    environment:
      - DASHDOT_PORT=3002
      - DASHDOT_WIDGET_LIST=os,cpu,storage,ram,network
      - DASHDOT_PAGE_TITLE=EyeDen
      - DASHDOT_ALWAYS_SHOW_PERCENTAGES=true
      - DASHDOT_ENABLE_CPU_TEMPS=true
      - DASHDOT_SHOW_HOST=true
      - DASHDOT_FS_VIRTUAL_MOUNTS=//192.168.0.6/docker
      - TZ=Europe/Paris
      - TRUSTED_PROXIES=10.10.0.20
    volumes:
      - /:/mnt/host:ro
    devices:
      - /dev/dri:/dev/dri
    networks:
      tan-network:
        ipv4_address: 10.10.0.41
    labels:
      - traefik.enable=true
      - traefik.http.routers.dash.rule=Host(`dash.luckyden.org`)
      - traefik.http.routers.dash.entrypoints=websecure
      - traefik.http.routers.dash.tls.certresolver=cloudflare
      - traefik.http.services.dash.loadbalancer.server.port=3002
      - traefik.http.services.dash.loadbalancer.passhostheader=true
      # - traefik.http.routers.dash.middlewares=authentik@docker

  homarr:
    restart: unless-stopped
    image: ghcr.io/homarr-labs/homarr:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /home/docker/DenHub/homarr/data:/appdata
    environment:
      - SECRET_ENCRYPTION_KEY=${DENHUB_ENC_KEY}
      - BASE_URL=${DENHUB_URL}
      - TRUSTED_PROXIES=10.10.0.20
    networks:
      tan-network:
        ipv4_address: 10.10.0.42
    labels:
      - traefik.enable=true
      - traefik.http.routers.homarr.rule=Host(`dashboard.luckyden.org`)
      - traefik.http.routers.homarr.entrypoints=websecure
      - traefik.http.routers.homarr.tls.certresolver=cloudflare
      - traefik.http.services.homarr.loadbalancer.server.port=7575

  uptime-kuma:
    restart: unless-stopped
    image: louislam/uptime-kuma:2
    volumes:
      - /home/docker//DenBear/data:/app/data
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      tan-network:
        ipv4_address: 10.10.0.43
    labels:
      - traefik.enable=true
      - traefik.http.routers.kuma.rule=Host(`kuma.luckyden.org`)
      - traefik.http.routers.kuma.entrypoints=websecure
      - traefik.http.routers.kuma.tls.certresolver=cloudflare
      - traefik.http.services.kuma.loadbalancer.server.port=3001

  guacamole_db:
    restart: unless-stopped
    image: postgres:17
    volumes:
      - /home/docker/DipDen/init:/docker-entrypoint-initdb.d:ro
      - /home/docker/DipDen/guacamole_db:/var/lib/postgresql/data:rw
    environment:
      - POSTGRES_DB=${DIPDEN_POSTGRES_DB}
      - POSTGRES_USER=${DIPDEN_POSTGRES_USER}
      - POSTGRES_PASSWORD=${DIPDEN_POSTGRES_PASSWORD}
    env_file:
      - .env
    networks:
      tan-network:
        ipv4_address: 10.10.0.44

  guacd:
    restart: unless-stopped
    image: guacamole/guacd:latest
    volumes:
      - /home/docker/DipDen/guacd_drive:/drive:rw
      - /home/docker/DipDen/guacd_record:/record:rw
    networks:
      tan-network:
        ipv4_address: 10.10.0.45

  guacamole:
    restart: unless-stopped
    hostname: DipDen
    image: guacamole/guacamole:latest
    volumes:
      - /home/docker/DipDen/guacamole_home:/etc/guacamole
    environment:
      - GUACD_HOSTNAME=guacd
      - GUACAMOLE_HOME=/etc/guacamole
      - POSTGRESQL_HOST=${DIPDEN_POSTGRESQL_HOST}
      - POSTGRESQL_DATABASE=${DIPDEN_POSTGRESQL_DATABASE}
      - POSTGRESQL_USERNAME=${DIPDEN_POSTGRESQL_USERNAME}
      - POSTGRESQL_PASSWORD=${DIPDEN_POSTGRESQL_PASSWORD}
      - POSTGRESQL_AUTO_CREATE_ACCOUNTS=true
      - REMOTE_IP_VALVE_ENABLED=true
      - TRUSTED_PROXIES=10.10.0.20
    env_file:
      - .env
    networks:
      tan-network:
        ipv4_address: 10.10.0.46
    depends_on:
      - guacamole_db
      - guacd
    labels:
      - traefik.enable=true
      - traefik.http.routers.guac.rule=Host(`guaca.luckyden.org`)
      - traefik.http.routers.guac.entrypoints=websecure
      - traefik.http.routers.guac.tls.certresolver=cloudflare
      - traefik.http.services.guac.loadbalancer.server.port=8080

  speedtest:
    restart: unless-stopped
    image: lscr.io/linuxserver/speedtest-tracker:latest
    environment:
      - PUID=1000
      - PGID=1000
      - APP_NAME=TurboDen
      - APP_TIMEZONE=Europe/Paris
      - DISPLAY_TIMEZONE=Europe/Paris
      - APP_KEY=${TURBODEN_APP_KEY}
      - DB_CONNECTION=sqlite
      - SPEEDTEST_SCHEDULE=0,30 * * * *
      - SPEEDTEST_SERVERS=${TURBODEN_SPEEDTEST_SERVERS}
      - PRUNE_RESULTS_OLDER_THAN=7
      - TZ=Europe/Paris
      - MAIL_MAILER=smtp
      - MAIL_HOST=smtp.gmail.com
      - MAIL_PORT=465
      - MAIL_USERNAME=${TURBODEN_MAIL_USERNAME}
      - MAIL_PASSWORD=${TURBODEN_MAIL_PASSWORD}
      - MAIL_ENCRYPTION=tls
      - MAIL_FROM_ADDRESS=${TURBODEN_MAIL_FROM_ADDRESS}
      - MAIL_FROM_NAME=${TURBODEN_MAIL_FROM_NAME}
      - TRUSTED_PROXIES=10.10.0.20
    env_file:
      - .env
    volumes:
      - /home/docker/TurboDen/config:/config
    networks:
      tan-network:
        ipv4_address: 10.10.0.47
    labels:
      - traefik.enable=true
      - traefik.http.routers.speedtest.rule=Host(`speed.luckyden.org`)
      - traefik.http.routers.speedtest.entrypoints=websecure
      - traefik.http.routers.speedtest.tls.certresolver=cloudflare
      - traefik.http.services.speedtest.loadbalancer.server.port=80

networks:
  tan-network:
    external: true