version: "3"

services:
  traefik:
    image: traefik:2.4
    volumes:
      - ./traefik.yml:/etc/traefik/traefik.yml
      - /var/run/docker.sock:/var/run/docker.sock
    links:
      - server
    ports:
     - "3000:80"
     - "8080:8080"

  server:
    build: ./server
    links:
      - redis
    labels:
      - "traefik.http.routers.chat.rule=PathPrefix(`/`)"
      - traefik.http.services.chat.loadBalancer.sticky.cookie.name=server_id
      - traefik.http.services.chat.loadBalancer.sticky.cookie.httpOnly=true

  redis:
    image: redis:6-alpine
    labels:
      - traefik.enable=false
