Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/afa-farkhod/spring-boot-docker-api

Springboot java api which runs inside the docker container, and connection is checked with postman api
https://github.com/afa-farkhod/spring-boot-docker-api

docker java postman springboot

Last synced: about 1 month ago
JSON representation

Springboot java api which runs inside the docker container, and connection is checked with postman api

Awesome Lists containing this project

README

        

# [Spring-Boot-Docker-Api](https://spring.io/guides/topicals/spring-boot-docker/)
Springboot java api which runs inside the docker container, and connection is checked with postman api

- A Basic Dockerfile
- A Spring Boot application is easy to convert into an executable JAR file. All the Getting Started Guides do this, and every application that you download from Spring Initializr has a build step to create an executable JAR. With `Maven`, you run `./mvnw install`, With `Gradle`, you run `./gradlew build`.
- A basic Dockerfile to run that JAR would then look like this, at the top level of your project:
```
FROM eclipse-temurin:17-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
```
- Springboot java api which shows the connection with the postman api through the port:8080(locally), port: 8000 (docker), i've already created the image of the java api:


Image

- Then we start the docker image and direct it to another port:


Image

- And now we can check it from postman client side:


Image

- As we can see it is giving the previously created information from the docker container


Image