- You will build a simple Spring Boot CRUD API for Notes-Taking Application with a backend MySQL DB and NGINX setup as a reverse proxy server running inside Docker containers.
These instructions will give you a copy of the project up and running on your local machine.
- Docker CE - Please read Install Docker Desktop for Windows
- REST API Client - Please read Download Postman for Windows
- Clone the application
git clone https://github.com/rajithatapattu/spring-boot-app-with-db-nginx.git
- Run the Application
> docker-compose up -d
Creating spring-boot-app-with-db-nginx_mysql-standalone_1 ... done
Creating spring-boot-app-with-db-nginx_easy-notes-app_1 ... done
Creating prod-nginx ... done
>
The app will start running at http://localhost:7070
NOTE: I have created 2 Docker container images. One with NGINX configurations and the other with the Spring Boot Application. They are uploaded to https://hub.docker.com/ and are public. How to build them can be found at the end of Readme file
rajithdocker/nginx:3.0
rajithdocker/easy-notes:1.0
- The Application will define the following CRUD APIs and you can test them using postman or any other REST API clients
Create a new Note using POST
POST /api/notes
Retrieving all Notes using GET
GET /api/notes
Retrieving a single Note using GET
GET /api/notes/{noteId}
Updating a Note using PUT
PUT /api/notes/{noteId}
Deleting a Note using DELETE
DELETE /api/notes/{noteId}
How to build the NGINX and Application container images:
* Nginx Container Image
Spin up a container using nginx image at Docker Hub and replace the /etc/nginx/conf.d/default.conf with the default.conf file provided in the project and create an image.
* Spring Boot Application Container Image
Use the Dockerfile provided in the project to create the application container image