Docker Templates
All Templates

TeamCity

A powerful, user-friendly CI/CD server designed for automating software build, test, and deployment pipelines.

DevOpsUpdated 17 days agoยท2 files
1.3 KB|48 lines
# Default ${TEAMCITY_VERSION} is defined in .env file

# ./buildserver_pgdata - Posgres DB data
# ./data_dir - TeamCity data directory
# ./teamcity-server-logs - logs of primary TeamCity server
# ./agents/agent-1/conf - configuration directory for the first build agent
# ./agents/agent-1/conf - configuration directory for the second build agent

volumes:
  pgdata:

services:
  db:
    image: postgres:${PG_VERSION}
    restart: always
    environment:
      - POSTGRES_PASSWORD=teamcity_password
      - POSTGRES_USER=teamcity_user
      - POSTGRES_DB=teamcity_db
    volumes:
      - pgdata:/var/lib/postgresql/${PG_VERSION}/docker
    ports:
      - 5433:5432

  teamcity:
    image: jetbrains/teamcity-server:${TEAMCITY_VERSION}
    ports:
      - "8112:8111"
    volumes:
      - ./data_dir:/data/teamcity_server/datadir
      - ./teamcity-server-logs:/opt/teamcity/logs
    depends_on:
      - db

  teamcity-agent-1:
    image: jetbrains/teamcity-agent:${TEAMCITY_VERSION}-linux-sudo
    privileged: true
    volumes:
      - ./agents/agent-1/conf:/data/teamcity_agent/conf
    environment:
      - DOCKER_IN_DOCKER=start
  teamcity-agent-2:
    image: jetbrains/teamcity-agent:${TEAMCITY_VERSION}-linux-sudo
    privileged: true
    volumes:
      - ./agents/agent-2/conf:/data/teamcity_agent/conf
    environment:
      - DOCKER_IN_DOCKER=start