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.
- After installation, when you first log in, it is recommended to change the Encryption Key.
- Login to TeamCity.
- Admin => Server Administration => Global Settings => Encryption Settings.
- Check the Use custom encryption key box, set the Custom encryption key, and save settings. It is recommended to remember this key somehow.
Docker Build
docker-compose buildDocker Up (one of them)
docker-compose up -dmake docker-local-upDocker Stop (one of them)
docker-compose stopmake docker-local-stopDocker Restart (one of them)
make docker-restartmake 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
Creating Backup via maintainDB command-line tool.
There is a script (tc-backup.sh) in the project root that can help you backup your project settings. It can be executed when Docker is running.
bash tc-backup.shATTENTION! The scenario for this script was developed independently. It cannot 100% guarantee that it does not contain sensitive data!
As a result of executing the script, two arrays will appear in the root of the project:
- TeamCity_Backup_*_*_sanitized.zip (basic backup without sensitive data)
- TeamCity_Backup_*_*_sensitive.zip (very sensitive data, better to store separately from backup)