I am running a .war
file developed by another company,
Currently, I started using Tomcat of EB, but I just wanted to make it Docker in consideration of quick operation check locally and ease of scaling.
The goal is to write a Dockerfile and quickly complete a local Dockerfile.
FROM tomcat:8.5-jdk15-openjdk-slim
ENV CATALINA_HOME /usr/local/tomcat
ENV PATH $CATALINA_HOME/bin:$PATH
WORKDIR $CATALINA_HOME
COPY sample.war webapps/sample.war
The version of tomcat is 8.5 series currently used and started for the time being. In tomcat, if you deploy the war file under webapps, it will be expanded automatically, so just set up tomcat and copy the war file.
After that, hit the tag appropriately and start the container
$ docker build . -t sample:0.1
$ docker container run --name sample-container -p 80:8080 sample:0.1
After that, since the war file is expanded, access http: // localhost/{war file name} /
Recommended Posts