Skip to content

Instantly share code, notes, and snippets.

@JohnZavyn
Created May 1, 2018 18:36
Show Gist options
  • Save JohnZavyn/30d1a773a9535f964c670d7e219f77ab to your computer and use it in GitHub Desktop.
Save JohnZavyn/30d1a773a9535f964c670d7e219f77ab to your computer and use it in GitHub Desktop.
Docker file to run an exploded Spring Boot WAR
FROM openjdk:8-alpine
ENV TZ America/New_York
RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime
RUN echo "${TZ}" > /etc/timezone
# Declare the working directory
WORKDIR /microservice
# Copy and explode the WAR to the working directory
COPY my-application/target/*-exec.war /microservice.war
RUN jar xvf /microservice.war
RUN rm /microservice.war
# RUN the microservice
ENTRYPOINT ["java", "org.springframework.boot.loader.WarLauncher"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment