{"id":30754238,"url":"https://github.com/twogg-git/java-teamcity","last_synced_at":"2026-04-11T08:02:22.931Z","repository":{"id":39839768,"uuid":"118422571","full_name":"twogg-git/java-teamcity","owner":"twogg-git","description":"Working with TeamCity + Docker to setup a CI pipeline for a Java REST app","archived":false,"fork":false,"pushed_at":"2022-12-16T09:52:51.000Z","size":9339,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-04T09:31:06.676Z","etag":null,"topics":["ci","docker","java","maven","teamcity","tomcat"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twogg-git.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-22T07:35:44.000Z","updated_at":"2020-07-02T23:57:43.000Z","dependencies_parsed_at":"2022-09-10T10:38:25.667Z","dependency_job_id":null,"html_url":"https://github.com/twogg-git/java-teamcity","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/twogg-git/java-teamcity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twogg-git%2Fjava-teamcity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twogg-git%2Fjava-teamcity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twogg-git%2Fjava-teamcity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twogg-git%2Fjava-teamcity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twogg-git","download_url":"https://codeload.github.com/twogg-git/java-teamcity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twogg-git%2Fjava-teamcity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31673068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","docker","java","maven","teamcity","tomcat"],"created_at":"2025-09-04T09:07:37.304Z","updated_at":"2026-04-11T08:02:22.920Z","avatar_url":"https://github.com/twogg-git.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n### Java + Codeship + Dokcer\n[![Codeship Status for twogg-git/java-teamcity](https://app.codeship.com/projects/b1a1da20-d275-0137-634b-26e80c92f4d3/status?branch=master)](https://app.codeship.com/projects/369866)\n\nWorking with TeamCity + Docker to setup a CI pipeline for a Java REST app\n\n#### Java REST App\nHere is the Docker command to run the app with a Tomcat 8.0 server. Please take care that we have to use Java 1.7 because of this specifical Tomcat version. I added the war copy command, so our app will be deployed automatically. \n```sh\ndocker run --rm -v /your_path/java-teamcity_test/java test/target/javatest.war:/usr/local/tomcat/webapps/javatest.war -it -p 8585:8080 --name=tomcat tomcat:8.0\n```\n\nIf you need to check the deployment, logs, or setup of Tomcat container use this command:\n```sh\ndocker exec -it tomcat /bin/bash\n```\n\nTest the app going to:\n```sh\nhttp://localhost:8585/javatest\n```\nI added two more rest services a dummy hello call */javatest/hello* and a test/id validation *test/error*.\n\n#### TeamCity Server \nFirst create two folders */data* and */logs* to storage what TC needs. This image will take a while to download (current local size used: 1.52GB).\n```sh\ndocker run -it --name tcserver -v /your_path/teamcity/data:/data/teamcity_server/datadir -v /your_path/teamcity/logs:/opt/teamcity/logs -p 8111:8111 jetbrains/teamcity-server\n```\nI'm using the internal HSQLDB database provided by the image to avoid futher setup, if you have time use an external option!\n\n#### TeamCity Agent \nThere is two version for agents, in my case, I used the standard one, you can try with the minimal. The standard version is another heavy image to download, so be patient (current local size used: 1.03GB).\n```sh\ndocker run --name tcagent -it -e SERVER_URL=\"your_ip:8111\" -p 9090:9090 -v /your_path/teamcity/agent:/data/teamcity_agent/conf jetbrains/teamcity-agent\n```\nTeamCity Agents will not work with *localhost* as SERVER_URL, so please use your IP. If you change your IP or network connection, modify *serverUrl* inside buildAgent.properties then restart the docker\n```sh\ndocker start tcagent\n```\n\n#### Adding local agent to the server\nThe final step, you have to authorize manually your local agent here:\n```sh\nhttp://localhost:8111/agents.html?tab=unauthorizedAgents\n```\n\n#### Deploying the artifact to a Tomcat container\n\n##### Tomcar container\nIn the new version on TeamCity is possible to deploy directly to a container locally or remote, we are going to use the same Tomcat 8.0 image, but adding context and user setup. Go to */tomcat* folder and then build the Dockerfile.\n```sh\ndocker build -t twogg/tomcat .\n```\nNow run the container, we re using admin/admin as user and password, and 8787 is going to be our deploy port for TeamCity.\n```sh\ndocker run -d -p 8787:8080 --name tctomcat twogg/tomcat\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwogg-git%2Fjava-teamcity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwogg-git%2Fjava-teamcity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwogg-git%2Fjava-teamcity/lists"}