version: '3.8'

services:
  web:
    restart: unless-stopped
    image: registry.cball5.club/blog:latest
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.web.rule=Host(`blog.cball5.club`)"
      - "traefik.http.routers.web.entrypoints=web" #,websecure"
      - "traefik.http.services.web.loadbalancer.server.port=80"
    environment:
      - HUGO_BASEURL=https://blog.cball5.club

    networks:
      - web

  traefik:
    image: traefik:v3.2.2
    container_name: traefik
    restart: unless-stopped
    command:
      - "--log.level=DEBUG"
      - "--entrypoints.web.address=:80"

      - "--providers.docker=true"
    ports:
      - "80:80" 
      - "443:443"

    volumes:
      - "./traefik:/etc/traefik"
      - "/var/run/docker.sock:/var/run/docker.sock"
    networks:
      - web
    depends_on:
      - web
  cloudflared:
    image: cloudflare/cloudflared:latest
    container_name: cloudflared
    restart: unless-stopped
    command: tunnel run
    volumes:
      - ./cloudflared:/etc/cloudflared
    environment:
      - TUNNEL_TOKEN={{SECRET_PLACEHOLDER}} 
    networks:
      - web

networks:
  web: {}

