-
Run with
docker-compose up -d
Note
|
SwaggerUI is available on http://api.demo-app.127.0.0.1.nip.io:8080/swagger-ui.html |
1) Build backend
docker build -t springboot2-app springboot2-app/
2) Start database
docker run --name database --rm \
-e POSTGRES_USER=springboot \
-e POSTGRES_PASSWORD=changeme \
postgres:10
3) Get database IP address
docker inspect database
Note
|
Find information under Network / bridge / IPAddress
|
4) Start backend
docker run --name backend --rm \
-p 8090:8080 \
-e DATABASE_HOSTNAME=172.17.0.2 \
-e DATABASE_PORT=5432 \
-e DATABASE_USERNAME=springboot \
-e DATABASE_PASSWORD=changeme \
springboot2-app
5) Go to SwaggerUI to check