{"id":19548895,"url":"https://github.com/sbcd90/docker-java-sample-webapp","last_synced_at":"2025-09-17T16:24:03.135Z","repository":{"id":51051480,"uuid":"135107983","full_name":"sbcd90/docker-java-sample-webapp","owner":"sbcd90","description":"A simple java webapp + docker + docker-compose + kubernetes exploration project","archived":false,"fork":false,"pushed_at":"2024-03-16T08:26:54.000Z","size":5,"stargazers_count":10,"open_issues_count":4,"forks_count":39,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T17:47:48.784Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sbcd90.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-05-28T04:04:44.000Z","updated_at":"2022-03-30T13:37:10.000Z","dependencies_parsed_at":"2022-08-28T07:02:05.823Z","dependency_job_id":null,"html_url":"https://github.com/sbcd90/docker-java-sample-webapp","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/sbcd90%2Fdocker-java-sample-webapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbcd90%2Fdocker-java-sample-webapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbcd90%2Fdocker-java-sample-webapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbcd90%2Fdocker-java-sample-webapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbcd90","download_url":"https://codeload.github.com/sbcd90/docker-java-sample-webapp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251051289,"owners_count":21528786,"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":[],"created_at":"2024-11-11T03:57:19.471Z","updated_at":"2025-09-17T16:23:58.066Z","avatar_url":"https://github.com/sbcd90.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"docker-java-sample-webapp\n=========================\n\n## Getting started\n\n- Build the java app\n\n`mvn clean install`\n\n- Take the war file from `target` \u0026 put it into `src/main/docker` directory.\n\n## Docker commands approach\n\n- Go into `src/main/docker` directory\n\n- Build the docker image\n\n`docker build -t tomcat:1 .`\n\n- Run the image inside a container\n\n`docker container run -p 8080:8080 tomcat:1`\n\n- Go to `http://localhost:8080/docker-java-sample-webapp-1.0-SNAPSHOT?name=World` \u0026 see the app running in docker\n\n- List all containers\n\n`docker container ls`\n\n- Stop container\n\n`docker container kill \u003ccontainer-id\u003e`\n\n- Remove container\n\n`docker rm \u003ccontainer-id\u003e`\n\n- List all images\n\n`docker images`\n\n- Remove image\n\n`docker rmi tomcat:1`\n\n- Remove base image\n\n`docker rmi bitnami/tomcat:latest`\n\n## Docker compose approach\n\n- Go into `src/main/docker` directory\n\n- Execute the command\n\n`docker-compose up`\n\n- When it is stopped, the corresponding containers are deleted also. But images remain. They have to be deleted using commands.\n\n## Kubernetes approach\n\n- Use docker edge channel. It has inbuilt kubernetes support.\n\n- To get kubernetes dashboard running\n\n- `kubectl cluster-info`\n- `kubectl -n kube-system edit service kubernetes-dashboard`\n- `You should see yaml representation of the service. Change type: ClusterIP to type: NodePort and save file. If it's already changed go to next step.`\n- `kubectl -n kube-system get service kubernetes-dashboard`\n\n- Now deploy the war\n\n- Use helm 2.8.2\n- `helm.exe install .`\n\n- To delete entire deployment\n- `kubectl delete deployment kissing-fish-java-sample-webapp`\n\n\n## Extras\n\n- Log into the container\n\n`docker exec -it [container-id] bash`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbcd90%2Fdocker-java-sample-webapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbcd90%2Fdocker-java-sample-webapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbcd90%2Fdocker-java-sample-webapp/lists"}