FROM jelastic/maven:3.9.5-openjdk-21 AS build
COPY . .
RUN mvn clean package -DskipTests
FROM oraclelinux:8-slim
COPY --from=build /target/petflix-0.0.1-SNAPSHOT.jar petflix.jar
EXPOSE 8080
CMD [“java”,“-jar”,“/app.jar”]
I also use a h2 database which is configured in my application.properties. The h2 is in the /data folder of my application. I use spring.datasource.url=jdbc:h2:file: (and all the other mandatory options) to connect
I tried a lot of technics to make the deploy pass, but every time I try, I always have the same results
I have a very basic Spring Boot example that deploys and returns requests. Maybe that will help to compare to see if there’s any particular configuration you need to get your project up and running.
As for the database, you’ll need to note that Render instances have an ephemeral filesystem, meaning any file written to the instance after it has booted will be lost when it next restarts (e.g. spun down if on free instance type, next deploy, manual restart, etc.).
If you want to persist data between restarts on your service, you’ll need to have a persistent store, e.g. a Render Disk (which is chargeable and also requires a paid instance type) or a database instance.