Running Satisfactory game server behind traefik v2

Hello everyone,

I want to run the following Satisfactory dedicated game server behind traefik v2: GitHub - wolveix/satisfactory-server: A Dockerized version of the Satisfactory dedicated server

Since I am new to traefik I am having problems setting everything up.
I configured the entrypoints and 3x udp router and 3x udp service for the game server docker container, but I was not able to connect to the game server through traefik, if i directly expose the ports on my VPS I can connect without any problems.

I think I am missing some details, could anyone please help me out with some example configuration for the linked docker container? Thanks in advance.

If you use Traefik, please post your static (entrypoints, etc.) and dynamic (routers, services, etc.) config. And your full docker-compose.yml.

@bluepuma77 sorry, thanks for mentioning, here are my configuration files:

version: '3'

services:

  traefik:
    image: traefik:v2.9
    container_name: 'traefik'
    hostname: 'traefik'
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
      - "20777:20777/udp"
      - "20000:20000/udp"
      - "9898:9898/udp"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - TRAEFIK_API_INSECURE=true
      - TRAEFIK_PROVIDERS_DOCKER=true
      - TRAEFIK_ENTRYPOINTS_WEB_ADDRESS=:80
      - TRAEFIK_ENTRYPOINTS_WEBSECURE_ADDRESS=:443
      - TRAEFIK_PROVIDERS_DOCKER_EXPOSEDBYDEFAULT=false
      # UDP
      - TRAEFIK_ENTRYPOINTS_sf01_ADDRESS=:20777/udp
      - TRAEFIK_ENTRYPOINTS_sf02_ADDRESS=:20000/udp
      - TRAEFIK_ENTRYPOINTS_sf03_ADDRESS=:9898/udp

and

version: '3'

services:
    satisfactory-server:
        container_name: 'sf0'
        hostname: 'sf0'
        image: 'wolveix/satisfactory-server:latest'
        labels:
            - "traefik.enable=true"
            - "traefik.udp.routers.rsf01.entrypoints=sf01"
            - "traefik.udp.routers.rsf01.service=ssf01"
            - "traefik.udp.routers.rsf02.entrypoints=sf02"
            - "traefik.udp.routers.rsf02.service=ssf02"
            - "traefik.udp.routers.rsf03.entrypoints=sf03"
            - "traefik.udp.routers.rsf03.service=ssf03"
            - "traefik.udp.services.ssf01.loadbalancer.server.port=20777"
            - "traefik.udp.services.ssf02.loadbalancer.server.port=20000"
            - "traefik.udp.services.ssf03.loadbalancer.server.port=9898"

        environment:
            - SERVERQUERYPORT=20777
            - SERVERBEACONPORT=20000
            - SERVERGAMEPORT=9898
            - MAXPLAYERS=4
            - PGID=1000
            - PUID=1000
            - STEAMBETA=false
            - AUTOPAUSE=true
            - AUTOSAVENUM=3
            - SKIPUPDATE=false
        restart: always
        deploy:
          resources:
            limits:
              memory: 16G
            reservations:
              memory: 12G

I don't think you can configure Traefik with environment variables. Usually the static configuration is done in command (or using a file via command: --configFile=/path/traefik.yml, but you can not mix) and the dynamic config in labels (or via additional providers like file).

Example docker-compose.yml:

version: '3.9'

services:
  traefik:
    image: traefik:v2.9
    ports:
      - published: 80
        target: 80
        protocol: tcp
        mode: host
      - published: 443
        target: 443
        protocol: tcp
        mode: host
    networks:
      - proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /root/traefik-certificates:/traefik-certificates
    command:
      --providers.docker=true
      --providers.docker.network=proxy
      --providers.docker.exposedByDefault=false
      --entryPoints.web.address=:80
      --entryPoints.web.http.redirections.entryPoint.to=websecure
      --entryPoints.web.http.redirections.entryPoint.scheme=https
      --entryPoints.websecure.address=:443
      --entryPoints.websecure.http.tls=true
      --api.debug=true
      --api.dashboard=true
      --log.level=DEBUG
      --accesslog=true
      --certificatesResolvers.myresolver.acme.email=mail@example.com
      --certificatesResolvers.myresolver.acme.tlschallenge=true
      --certificatesResolvers.myresolver.acme.storage=/traefik-certificates/acme.json
    labels:
      - traefik.enable=true
      - traefik.http.routers.mydashboard.entrypoints=websecure
      - traefik.http.routers.mydashboard.rule=Host(`traefik.example.com`)
      - traefik.http.routers.mydashboard.tls.certresolver=myresolver
      - traefik.http.routers.mydashboard.service=api@internal
      - traefik.http.routers.mydashboard.middlewares=myauth
      - traefik.http.middlewares.myauth.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/

  whoami:
    image: traefik/whoami:v1.8
    networks:
      - proxy
    labels:
      - traefik.enable=true
      - traefik.http.routers.mywhoami.entrypoints=websecure
      - traefik.http.routers.mywhoami.rule=Host(`example.com`) || Host(`www.example.com`)
      - traefik.http.routers.mywhoami.tls.certresolver=myresolver
      - traefik.http.services.mywhoami.loadbalancer.server.port=80

networks:
  proxy:
    name: proxy
    driver: overlay
    attachable: true

Note: I think network creation in docker-compose.yml only works with Docker Swarm

I found this ressource about env variables: Traefik Environment Variables Documentation - Traefik so I tried to use it.

Thank you for your fast reply, I will try it again with your method.