What I'm trying to do is simple, deploy a Spring Boot RESTful Web Service to EC2 so it's accessible publicly.
For this I need to do the following:
- Write Spring Boot web service, containerize and test locally - done
Here is my Dockerfile:
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
ADD ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
When I docker run this locally on 8080 it works fine (returns static json).
- Push to Dockerhub - done
- Launch an Amazon Linux AMI on aws and make it http accessible (port 80) - done
- Install apache (httpd) and start - done
Here is where I need some help
-
I run docker image from dockerhub like so
docker run --rm -p 80:8080 kaspartr/demo
It doesn't allow cause of course the port is taken by apache. And if I stop it and run it is deployed but I cannot access it online.
Can someone please explain how do you deploy docker image into the apache?
Do I need to change the Dockerfile or something else?
Thank you!!