If you prefer not to use Docker, then we could deploy the app with a production profile locally by completing the following steps:
- First, make sure that MySQL DB is running from the previous step; otherwise, start it usingĀ docker-compose -f src/main/docker/mysql.yml up -d.
- Now let's create an executable archive for the prod profile by running ./gradlew bootRepackage -Pprod.
- Once the build is successful, there will be two archives (WAR) created under build/libs. The store-0.0.1-SNAPSHOT.war file is an executable archive which can be run directly on a JVM, and the store-0.0.1-SNAPSHOT.war.original is a normal WAR file that can be deployed to a server such as JBoss or Tomcat.
- Let's use the executable archive. Just run ./build/libs/store-0.0.1-SNAPSHOT.war to start the application. If you are on Windows, run java -jar build/libs/store-0.0.1-SNAPSHOT.war.
Once the application starts up, you will see the URL printed on the console. VisitĀ http://localhost:8080 in your favorite browser to see the application in action.