A simple Spring-Boot based Java application to manage some cars. Comes along with a docker-compose file that first creates the necessary PostgreSQL database, followed by starting the Spring application.
Used IDEs, frameworks and tools:
- IntelliJ IDEA 2018.1 Ultimate
- Docker CE for Windows Version 18.03.1-ce-win65 (17513)
- Java JDK 1.8.0_171
- Docker Compose Version 3
- Maven as Build Tool
The following endpoints will be offered by the webservice (base-url: http://localhost:8080):
- /cars -> Return all cars from the PostgreSQL database
- /cars/{vin} -> Returns a car with the given vin
- Clone the repository and change into the repository via command line.
- Build the project using the 'mvn clean package' command.
- Check that your docker daemon is up and ready.
- Start a command line and navigate into the 'sqsdemoserver' directory.
- Execute 'docker-compose up --build' to start all the necessary containers.
Additional:
- Docker-compose will pull a docker image of PostgreSQL database and a java-jre-slim image in order to execute the .jar file.
- The containers will be linked together in a virtual docker network
- In the 'sqsdemoserver' folder you will see a shell script 'wait-for-it.sh'. Due to some problems in the development process i needed this file that the Spring-Boot Server will only be started if the PostgreSQL container is running and all required tables are created. The script is not part of my own project (see this repository).