How to deploy Spring boot Application with MySql.
To run a Spring Boot service on Render you will need to use Docker If don’t already have one here is an example you can use (this assumes you Maven, so you will need to modify this if you use Gradle):
## Build stage#FROM maven:3.9.6-eclipse-temurin-21 AS builderRUN mkdir /buildCOPY . /buildWORKDIR /buildRUN mvn clean package -DskipTests## Package stage#FROM eclipse-temurin:21-jdkRUN mkdir /appCOPY --from=builder /build/target/service-1.0-SNAPSHOT.jar /app/service.jarWORKDIR /appCMD ["java","-jar","service.jar"]
Just remember to change
servvice above to what the name of the jarfile your service builds.
As for MySQL, we do not provide any managed MySQL services. If you want to modify your service, you could use our Postgres services. Alternatively, you could run your own MySQL service on Render (this will not be a free service) or sign up to a 3rd party MySQL service.
Render Support, UTC+10