[Docker] Multi-stage Docker Build for React and Spring Boot
React using NPM and Nginx
Note that yarn
can be used instead of npm
. Feel free to use whichever works for your environment.
Because my React application makes requests to the Spring Boot backend, nginx.conf
was added to set up a reverse proxy.
Spring Boot using Maven
Note that Java Options can added in CMD
.
For example, when I set up an acceptance environment where Product Managers can test to accept or reject stories, I used this as CMD
instead:
CMD ["java", "-Dspring.profiles.active=docker", "-jar", "app.jar"]