version: "3"

networks:
  proxy:
    name: traefik_proxy

services:
  traefik:
    image: "traefik:latest"
    container_name: "traefik"
    command:
#      - "--log.level=DEBUG"
      #- "--log.filePath=/log/traefik.log"
      - "--accesslog=true"
      #- "--accessLog.filePath=/log/access.log"
      - "--api.insecure=false" # pokud chci dashboard
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      #- "--entryPoints.websecure.address=:443"
    restart: unless-stopped
    networks:
      - proxy
    ports:
      - "${HTTP_PORT:-80}:80"
      #- "443:443"
    volumes:
      #- "./traefik/log:/log"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "/etc/timezone:/etc/timezone:ro"
    environment:
      - "TZ=Europe/Prague"
  server:
    build:
      context: ./server
    networks:
      - proxy
    labels:
      - 'traefik.enable=true'
      - 'traefik.http.routers.server.rule=Host(`${DOMAIN:-localhost}`) && (PathPrefix(`/socket.io`) || PathPrefix(`/api`))'
  client:
    build:
      context: ./client
    ports:
      - 3000:3000
    networks:
      - proxy
    labels:
      - 'traefik.enable=true'
      - 'traefik.http.routers.client.rule=Host(`${DOMAIN:-localhost}`)'

