I have a Spring Boot application that needs to be deployed as a docker container on AWS. In our old production environment we packaged the application as a WAR file and deployed it to an application server. How can we package the application with the application server so that it can run as a docker container?
Each Spring Boot web application includes an embedded web server. Just run the JAR in the docker container and your application will spin-up, there is no need for a separate application server.
Dockerfile can be as simple as:
FROM openjdk:8-jdk-alpine
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
Don't forget to use the Spring Boot Maven Plugin to make the JAR executable.