docker run -it --rm --name my-maven-project -v "$PWD":/usr/src/mymaven -w /usr/src/mymaven -v /var/run/:/var/run/ maven mvn clean install
cd src/main/docker
docker-compose up
What happens:
- Starts Postgresql and waits up to 15 seconds for it to finish (using wait-for-it)
- Starts Spring boot application which populates database with some test data
Navigate to http://localhost:8080 and you should see: [{"id":1,"name":"A"},{"id":2,"name":"B"},{"id":3,"name":"C"}]