To the services section, add the SCM server Gogs first:
git-server:
image: gogs/gogs
ports:
- '10022:22'
- '10080:3000'
volumes:
- ./gogs:/data
We'll use an official Docker image. We set a persistent volume to keep all created repositories between starts. Also, we forwarded two ports—SSH (from local port 10022 to port 22 in the container) and HTTP (from local port 10080 to port 3000 in the container). To upload data with the Git client, we will use the local port, but to use the server from TeamCity, we have to use the port of the container.