TeamCity Server (Docker) behind Traefik example?

Hi guys, is there any example for running the TC server on Docker behind the Traefik example?

My current setup gives me “HTTP Status 404 – Not Found” when I try to reach it from the public URL (https://my-domain.com/tc).

compose.yaml

services:
  teamcity-server-instance:
    image: jetbrains/teamcity-server:latest
    container_name: teamcity-server-instance
    volumes:
      - C:/teamcity/data:/data/teamcity_server/datadir
      - C:/teamcity/logs:/opt/teamcity/logs
    environment:
      - TEAMCITY_HTTPS_PROXY_ENABLED=true
    ports:
      - "8111:8111"
    labels:
      - "traefik.docker.network=rp2_default"
      - "traefik.http.routers.teamcity-http.rule=(Host(`my-domain.com`) && PathPrefix(`/tc`))"
      - "traefik.http.routers.teamcity-http.middlewares=teamcity-https"
      - "traefik.http.middlewares.teamcity-https.redirectscheme.scheme=https"
      - "traefik.http.routers.teamcity-http.entrypoints=web"
      - "traefik.http.routers.teamcity.tls=true"
      - "traefik.http.routers.teamcity.tls.certresolver=letsencrypt"
      - "traefik.http.routers.teamcity.entrypoints=websecure"
      - "traefik.http.routers.teamcity.rule=(Host(`my-domain.com`) && PathPrefix(`/tc`))"
      - "traefik.http.services.teamcity.loadbalancer.server.port=8111"
    networks:
      - rp2_default

networks:
  rp2_default:
    external: true

Server URL inside Global Settings: http://my-domain.com/tc

 

1
1 comment
Hi,

There are no official examples of such configuration available. As a starting point, I suggest following the instructions for other proxy servers as an example of configuring it and making the necessary changes for the configuration to work in the Traefik context: https://www.jetbrains.com/help/teamcity/configuring-proxy-server.html.

Please also make sure to make the necessary changes to TeamCity's Tomcat server configuration as described here: https://www.jetbrains.com/help/teamcity/configuring-proxy-server.html#TeamCity+Tomcat+Configuration.

I will also link this GitHub repo which implements TeamCity as a Docker container behind Traefik: https://github.com/egregors/teamcity-docker-compose. Please note that this is not an official implementation, so using it with discretion is advised.

Best regards,
Anton
1

Please sign in to leave a comment.