https://docs.docker.com/compose/install/
The most interesting folders:
- ./local Folder for local changes. It can be convenient to use it together with the docker-compose.local.yml file.
- ./volumes The folder with Docker Volumes in Linux structure.
- ./volumes/data/teamcity_agent/conf/ Configuration files for agents.
- ./volumes/data/teamcity_server/datadir/ Server data dir.
- ./volumes/opt/buildagent_1/logs/ Build Agent 01 log files.
- ./volumes/opt/buildagent_2/logs/ Build Agent 02 log files.
- ./volumes/opt/buildagent_3/logs/ Build Agent 03 log files.
- ./volumes/opt/teamcity/logs/ TeamCity log files.
- Copy the ./.env.sample file to the ./.env. Check it and edit some parameters if needed.
- Copy the ./volumes/data/teamcity_agent/conf/agent1/buildAgent.properties.sample file to the .volumes/data/teamcity_agent/conf/agent1/buildAgent.properties for configuration Agent 1.
- Copy the ./volumes/data/teamcity_agent/conf/agent2/buildAgent.properties.sample file to the .volumes/data/teamcity_agent/conf/agent2/buildAgent.properties for configuration Agent 2.
- Copy the ./volumes/data/teamcity_agent/conf/agent3/buildAgent.properties.sample file to the .volumes/data/teamcity_agent/conf/agent3/buildAgent.properties for configuration Agent 3.
- Optional. Copy the ./docker-compose.local.yml.sample file to the ./docker-compose.local.yml and edit it, if you need some changes in the Docker configurations locally.
- Optional. If you want to have local domains for TeamCity, you need to:
- Configure proxy. For example, Nginx. You can use ./docker-compose.local.yml file and ./local folder for this.
- Add the data to your local /etc/hosts file, like:
127.0.0.1 teamcity.loc
- Optional. If you get error about permission problems, please do:
sudo chown -R 1000:1000 ./volumes/data/teamcity_server/datadir sudo chown -R 1000:1000 ./volumes/opt/teamcity/logs make docker-restart
- If everything is done correctly, then after starting Docker, the project will be available via the link http://localhost:8111/. Please proceed and continue with setup.
- Database connection setup.
- Select MySQL database type.
- Download JDBC driver for MySQL database type and put it into the ./volumes/data/teamcity_server/datadir/lib/jdbc.
- For example, the file can be downloaded here: https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.30/.
- The file name: mysql-connector-java-8.0.30.jar.
- Create an empty database.
Docker Build
docker-compose build
Docker Up (one of them)
docker-compose up -d
make docker-local-up
Docker Stop (one of them)
docker-compose stop
make docker-local-stop
Docker Restart (one of them)
make docker-restart
make docker-local-restart
- Host: mysql
- Port: 3306
- User: {see .env file}
- Password: {see .env file}
- Host: teamcity
- Port: 8111
- URL: http://localhost:8111/
- Host: teamcity-agent-1
- Config file: ./volumes/data/teamcity_agent/conf/agent1/buildAgent.properties
- Host: teamcity-agent-2
- Config file: ./volumes/data/teamcity_agent/conf/agent2/buildAgent.properties
- Host: teamcity-agent-3
- Config file: ./volumes/data/teamcity_agent/conf/agent3/buildAgent.properties