The goal of Staging # 1 is to setup a dummy project (Postgres + Spring Boot + React).
To learn and build this demo easily, here we break it into 3 small pieces.
SpringBoot(localhost) connect to Postgres(Container).
By following the 1st link, create Restful APIs which write/read data to DB.
SpringBoot is in localhost; Postgres is in container. So, the config of DB is
Read the 3st link; copy the finalized
docker file; past into the root of project Dockerfile.
FROM openjdk:8-jdk-alpine as build
...
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
FROM openjdk:8-jdk-alpine
...
ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.postgresdemo.PostgresDemoApplication"]
Build image:
DOCKER_BUILDKIT=1 docker build -t myorg/myapp .
Write docker-compose file
To run these containers easily, put instance info into docker-compose.yml
The goal of Staging # 1 is to setup a dummy project (Postgres + Spring Boot + React).
To learn and build this demo easily, here we break it into 3 small pieces.