You want to deploy a Spring Boot JAR application with:
sudo apt update
sudo apt upgrade -y
sudo apt install -y docker.io docker-compose openjdk-17-jdk nginx certbot python3-certbot-nginx
sudo systemctl enable docker
sudo systemctl start docker
Place this in the Spring Boot project root:
FROM openjdk:17-jdk-alpine
VOLUME /tmp
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]