{"id":20084877,"url":"https://github.com/tranphuquy19/springboot-docker","last_synced_at":"2026-04-13T05:49:08.212Z","repository":{"id":102182872,"uuid":"516942857","full_name":"tranphuquy19/SpringBoot-Docker","owner":"tranphuquy19","description":"Spring boot - Docker Multi-Stage build","archived":false,"fork":false,"pushed_at":"2022-07-24T18:04:11.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-13T02:13:46.910Z","etag":null,"topics":["docker","docker-compose","spring-boot"],"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/tranphuquy19.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-23T02:59:33.000Z","updated_at":"2022-07-25T03:16:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e1a985d-ace3-40ce-bceb-83df65132e84","html_url":"https://github.com/tranphuquy19/SpringBoot-Docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranphuquy19%2FSpringBoot-Docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranphuquy19%2FSpringBoot-Docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranphuquy19%2FSpringBoot-Docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranphuquy19%2FSpringBoot-Docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tranphuquy19","download_url":"https://codeload.github.com/tranphuquy19/SpringBoot-Docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241517679,"owners_count":19975294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["docker","docker-compose","spring-boot"],"created_at":"2024-11-13T15:53:39.084Z","updated_at":"2025-12-31T01:04:48.630Z","avatar_url":"https://github.com/tranphuquy19.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring boot - Docker Multi-Stage build\n\n- [What is a multi-stage build?](https://vsupalov.com/docker-multi-stage-advantages/)\n- [Official documentation](https://spring.io/guides/topicals/spring-boot-docker/)\n\n_Note: To reduce build time please enable DOCKER_BUILDKIT=1_\n\n```bash\nexport DOCKER_BUILDKIT=1 # enable Docker buildkit (for Linux)\n```\n\n## Usage\n\n### Using docker compose\n\n1. Build app image\n\n```bash\ndocker-compose -f docker-compose.prod.yml build demo\n```\n\n2. Start app\n\n```bash\ndocker-compose -f docker-compose.prod.yml up -d\n# This command will start only postgres and demo app containers\n```\n\nIf you want to start pgadmin too, you can use the following command:\n\n```bash\ndocker-compose -f docker-compose.prod.yml --profile debug up -d\n# This command will start all containers with debug profile [postgres, demo] + pgadmin4\n```\n\n3. Stop app\n\n```bash\ndocker-compose -f docker-compose.prod.yml stop\n```\n\n4. Destroy app\n\n```bash\ndocker-compose -f docker-compose.prod.yml down -v --remove-orphans\n# This will remove all containers and volumes (lost data)\n```\n\n5. Start postgres db and pgadmin4 for development\n\nNotice: Please modify the connection string in application.properties file (from `jdbc:postgresql://postgres:5432/demo` -\u003e `jdbc:postgresql://localhost:5432/demo`).\n\n```bash\ndocker-compose -f docker-compose.dev.yml up -d\n# This command will start postgres and pgadmin4 with the ports exposed on host machine\n```\n\n### Using docker CLI\n\n1. Build image\n\n```bash\ndocker build -t demo:latest .\n```\n\n2. Build builder image\n\n```bash\ndocker build --target builder -t demo:builder .\n```\n\n3. Run image\n\n```bash\ndocker run -p 8080:8080 demo:latest\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftranphuquy19%2Fspringboot-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftranphuquy19%2Fspringboot-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftranphuquy19%2Fspringboot-docker/lists"}