{"id":18822333,"url":"https://github.com/atulsingh11-0/springbootdocker","last_synced_at":"2026-04-12T09:47:26.047Z","repository":{"id":233092532,"uuid":"785989199","full_name":"AtulSingh11-0/springBootDocker","owner":"AtulSingh11-0","description":"learning how to dockerize a spring boot application","archived":false,"fork":false,"pushed_at":"2024-04-13T05:45:30.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-30T03:48:12.310Z","etag":null,"topics":["api","docker","java","postman","spring"],"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/AtulSingh11-0.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}},"created_at":"2024-04-13T05:04:23.000Z","updated_at":"2024-04-13T05:05:54.000Z","dependencies_parsed_at":"2024-04-13T20:19:43.288Z","dependency_job_id":null,"html_url":"https://github.com/AtulSingh11-0/springBootDocker","commit_stats":null,"previous_names":["atulsingh11-0/springbootdocker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtulSingh11-0%2FspringBootDocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtulSingh11-0%2FspringBootDocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtulSingh11-0%2FspringBootDocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtulSingh11-0%2FspringBootDocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AtulSingh11-0","download_url":"https://codeload.github.com/AtulSingh11-0/springBootDocker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239758901,"owners_count":19692041,"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":["api","docker","java","postman","spring"],"created_at":"2024-11-08T00:48:57.618Z","updated_at":"2026-01-18T15:30:15.943Z","avatar_url":"https://github.com/AtulSingh11-0.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\n\n# Spring Boot Application Dockerization Guide\n\nWelcome to the Dockerization guide for your Spring Boot application! This guide will walk you through the process of dockerizing your application along with a MySQL database container.\n\n## Technology Stack\n\nThis Spring Boot application utilizes the following technology stack:\n\n- **Spring Boot**: A powerful framework for building Java-based applications.\n- **MySQL**: An open-source relational database management system.\n- **Docker**: A platform for building, shipping, and running applications in containers.\n\nFeel free to replace any components of this stack with alternatives that better suit your project's needs.\n\n## Prerequisites\n\nBefore getting started, make sure you have the following installed on your machine:\n\n- [Docker](https://docs.docker.com/get-docker/): Docker engine for containerization.\n- Basic understanding of Docker concepts.\n\n## Dockerizing MySQL Container\n\nTo dockerize MySQL, execute the following command:\n\n```bash\ndocker run -p 3307:3306 --name mysqldb -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=test mysql:8.0.34\n```\n\nThis command will create and run a MySQL container with the specified configurations.\n\n## Building Spring Boot Application Docker Image\n\nTo build a Docker image for your Spring Boot application, use the following command:\n\n```bash\ndocker build -t springboot-docker .\n```\n\nThis command will build a Docker image named `springboot-docker` from the Dockerfile in your project directory.\n\n## Creating Docker Network\n\nCreate a Docker network to facilitate communication between containers:\n\n```bash\ndocker network create spring-net\n```\n\n## Connecting Spring Boot Application to MySQL Container\n\nConnect your Spring Boot application container to the MySQL container using the created network:\n\n```bash\ndocker network connect spring-net mysqldb\n```\n\n## Running Spring Boot Application Container\n\nFinally, run your Spring Boot application container with the following command:\n\n```bash\ndocker run -p 9090:6001 --name spring-app --net spring-net -e MYSQL_HOST=mysqldb -e MYSQL_USER=root -e MYSQL_PASSWORD=root -e MYSQL_PORT=3307 springboot-docker\n```\n\nReplace `spring-app` with the desired name for your container and `springboot-docker` with the name of your Docker image.\n\n## Notes\n\n- Ensure that your Spring Boot application is configured to connect to the MySQL database using the provided environment variables (`MYSQL_HOST`, `MYSQL_USER`, `MYSQL_PASSWORD`, `MYSQL_PORT`).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatulsingh11-0%2Fspringbootdocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatulsingh11-0%2Fspringbootdocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatulsingh11-0%2Fspringbootdocker/lists"}