https://github.com/enpit/springboot-rest-service
https://github.com/enpit/springboot-rest-service
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/enpit/springboot-rest-service
- Owner: enpit
- Created: 2018-03-26T21:05:40.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-26T21:15:27.000Z (about 8 years ago)
- Last Synced: 2025-01-14T18:08:58.312Z (over 1 year ago)
- Language: Java
- Size: 3.91 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo Springboot REST Service
inkl. Dockerfile. Beispiel basiert auf Springboot 2.0.0 (vgl. https://start.spring.io/ mit "Web" Dependency)
## Prerequsites
* Java 1.8
* Maven 3.x
* Docker
## Get the Sourcecode
```
git clone https://github.com/enpit/springboot-rest-service.git
```
## Build service
```
mvn package
```
## Run service
```
java -jar target/rest-service-0.0.1-SNAPSHOT.jar
```
or using the springboot maven plugin
```
mvn spring-boot:run
```
Access service through browser at http://localhost:8080/hello
## Build Docker image
```
docker build -t enpit/springboot-rest-service .
```
## Run Docker Container
```
docker run --name springboot-rest-service -p 8080:8080 -d enpit/springboot-rest-service
```
Access service through browser at http://localhost:8080/hello
## Cleanup
Stop Container
```
docker rm -f springboot-rest-service
```
Remove image
```
docker rmi enpit/springboot-rest-service
```
## Further information
Please make sure you have the right understanding of running Java in a Container: https://jaxenter.com/nobody-puts-java-container-139373.html