Created
May 10, 2021 20:20
-
-
Save bschaatsbergen/30ef51f416000b7eea9809280acc134d to your computer and use it in GitHub Desktop.
Dockerized TeamCity cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.1' | |
# ./buildserver_pgdata - Postgres DB data | |
# ./data - TeamCity data directory | |
# ./teamcity-server-logs1 - logs of primary TeamCity server | |
# ./teamcity-server-logs2 - logs of secondary TeamCity server (running-builds node) | |
# ./teamcity-server-logs3 - logs of read-only TeamCity server (secondary node) | |
# ./teamcity-agent-conf1 - conf directory for the build agent | |
# ./teamcity-agent-conf2 - conf directory for the build agent | |
# ./teamcity-agent-conf3 - conf directory for the build agent | |
services: | |
db: | |
image: postgres | |
restart: always | |
ports: | |
- 5433:5432 | |
environment: | |
POSTGRES_USER: user | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: buildserver | |
volumes: | |
- ./buildserver_pgdata:/var/lib/postgresql/data | |
main: | |
image: jetbrains/teamcity-server | |
volumes: | |
- ./data:/data/teamcity_server/datadir | |
- ./teamcity-server-logs1:/opt/teamcity/logs | |
ports: | |
- 8111:8111 | |
node1: | |
image: jetbrains/teamcity-server | |
volumes: | |
- ./data:/data/teamcity_server/datadir | |
- ./teamcity-server-logs2:/opt/teamcity/logs | |
ports: | |
- 8112:8111 | |
environment: | |
TEAMCITY_SERVER_OPTS: -Dteamcity.server.rootURL=http://node1:8111 | |
node2: | |
image: jetbrains/teamcity-server | |
volumes: | |
- ./data:/data/teamcity_server/datadir | |
- ./teamcity-server-logs3:/opt/teamcity/logs | |
ports: | |
- 8113:8111 | |
environment: | |
TEAMCITY_SERVER_OPTS: -Dteamcity.server.rootURL=http://node2:8111 | |
agent1: | |
image: jetbrains/teamcity-agent:latest | |
environment: | |
SERVER_URL: http://teamcity:8111 | |
volumes: | |
- ./teamcity-agent-conf1:/data/teamcity_agent/conf | |
- /var/run/docker.sock:/var/run/docker.sock | |
agent2: | |
image: jetbrains/teamcity-agent:latest | |
environment: | |
SERVER_URL: http://teamcity:8111 | |
volumes: | |
- ./teamcity-agent-conf2:/data/teamcity_agent/conf | |
- /var/run/docker.sock:/var/run/docker.sock | |
agent3: | |
image: jetbrains/teamcity-agent:latest | |
environment: | |
SERVER_URL: http://teamcity:8111 | |
volumes: | |
- ./teamcity-agent-conf3:/data/teamcity_agent/conf | |
- /var/run/docker.sock:/var/run/docker.sock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TeamCity docker-compose multi-node sample
Starts TeamCity in docker-compose with several servers of different roles (Ubuntu-based).
Requires at least 4Gb of RAM in the docker engine.
psql -p5433 -hlocalhost -Uuser -dbuildserver
, passwordpassword
)For details on volumes, created folders, logs see docker-compose.yml file.
To start
Next, open http://localhost:8111 for the initial setup.
After creating a user, visit "Agents -> Unauthorized" to authorize the build agent.
See https://localhost:8111/admin/admin.html?item=nodesConfiguration for nodes configuration.
To shutdown