Skip to content

Teamcity

  • docker-compose.yml

With postgres db

services:
  teamcity:
    image: jetbrains/teamcity-server
    container_name: teamcity
    hostname: teamcity
    ports:
      - 8111:8111
    restart: unless-stopped
    volumes:
      - ./data:/data/teamcity_server/datadir
      - ./logs:/opt/teamcity/logs

  agent:
    image: jetbrains/teamcity-agent:latest
    container_name: agent
    volumes:
      - ./agent_conf:/data/teamcity_agent/conf
    environment:
      - SERVER_URL=http://teamcity:8111

  postgres:
    image: postgres:17.6-alpine
    restart: unless-stopped
    container_name: postgres
    environment:
      - POSTGRES_USER=teamcity
      - POSTGRES_PASSWORD=teamcitypass
      - POSTGRES_DB=teamcity
    ports:
      - 5432:5432
    volumes:
      - ./postgres-db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
      interval: 5s
      timeout: 5s
      retries: 5
      start_period: 10s