You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
3.2 KiB
YAML
83 lines
3.2 KiB
YAML
# vim:ts=2:sts=2:sw=2:et
|
|
#
|
|
# Author: Hari Sekhon
|
|
# Date: 2020-11-24 15:40:47 +0000 (Tue, 24 Nov 2020)
|
|
#
|
|
# https://github.com/harisekhon/bash-tools
|
|
#
|
|
# License: see accompanying Hari Sekhon LICENSE file
|
|
#
|
|
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish
|
|
#
|
|
# https://www.linkedin.com/in/harisekhon
|
|
#
|
|
|
|
# XXX: you must set an external RDBMS for production deployments (I use Cloud SQL)
|
|
|
|
version: '3'
|
|
|
|
services:
|
|
teamcity-server:
|
|
hostname: teamcity-server
|
|
# 2GB docker image
|
|
image: jetbrains/teamcity-server:${VERSION:-2020.2}
|
|
ports:
|
|
- 8111:8111
|
|
healthcheck:
|
|
#test: ["CMD", "curl", "-f", "http://localhost:8111"]
|
|
# export DOCKER_HEALTHCHECK=/bin/true in development to bypass healthcheck
|
|
test: "${DOCKER_HEALTHCHECK:-curl http://localhost:8111}"
|
|
interval: 30s
|
|
start_period: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
environment:
|
|
#TEAMCITY_SERVER_MEM_OPTS: "-Xmx2g -XX:MaxPermSize=270m -XX:ReservedCodeCacheSize=350m"
|
|
TEAMCITY_SERVER_MEM_OPTS: "-Xmx512m"
|
|
volumes:
|
|
# for server.xml override:
|
|
#- teamcity/conf::/opt/teamcity/conf
|
|
# XXX: consider switching out of /tmp for better persistance to another Docker shared directory
|
|
- /tmp/teamcity/server/datadir:/data/teamcity_server/datadir
|
|
- /tmp/teamcity/server/logs:/opt/teamcity/logs
|
|
teamcity-agent:
|
|
hostname: teamcity-agent
|
|
# 1.3GB docker image
|
|
image: jetbrains/teamcity-agent:${VERSION:-2020.2}
|
|
#image: jetbrains/teamcity-agent:${VERSION:-2020.2}-linux-sudo
|
|
ports:
|
|
- 9090:9090
|
|
# needs root to be able to install OS package dependencies - 'sudo' not installed unless using the linux-sudo suffix, which is a lot bigger and similar result
|
|
# Since version 2020.1, TeamCity agent Docker images run under a non-root user by default
|
|
#user: root:root
|
|
environment:
|
|
SERVER_URL: http://teamcity-server:8111
|
|
# this name is used to verify and automatically authorize the agent(s) in teamcity.sh so must be set
|
|
AGENT_NAME: agent1
|
|
# XXX: currently authorize via API in teamcity.sh
|
|
#AGENT_TOKEN:
|
|
healthcheck:
|
|
#test: ["CMD", "curl", "-f", "http://localhost:9090"]
|
|
# export DOCKER_HEALTHCHECK=/bin/true in development to bypass healthcheck
|
|
test: "${DOCKER_HEALTHCHECK:-curl http://localhost:9090}"
|
|
interval: 30s
|
|
start_period: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
restart: on-failure
|
|
links:
|
|
- teamcity-server
|
|
volumes:
|
|
# XXX: consider switching out of /tmp for better persistance to another Docker shared directory
|
|
# checked out sources
|
|
- /tmp/teamcity/agent1/work:/opt/buildagent/work
|
|
#
|
|
# internal build agent caches
|
|
# XXX: causes: WARN - ig.BuildAgentConfigurablePaths - Failed to create directory: /opt/buildagent/system/.artifacts_cache
|
|
# XXX: causes agent to get stuck looping on bootstrap/upgrade process dying
|
|
#- /tmp/teamcity/agent1/system:/opt/buildagent/system
|
|
#
|
|
# plugins
|
|
# XXX: causes agent to get stuck looping on bootstrap/upgrade process dying
|
|
#- /tmp/teamcity/agent1/plugins:/opt/buildagent/plugins
|