Skip to content

Commit

Permalink
Merge pull request #39 from attadanta/better-docker-build
Browse files Browse the repository at this point in the history
Build docker image from source.
  • Loading branch information
dvcama authored Apr 12, 2020
2 parents df9d52d + ee35e29 commit d64a560
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
15 changes: 15 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.project
.metadata
.idea
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
.springBeans
target/
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM tomcat
MAINTAINER [email protected]

RUN cd /usr/local/tomcat/webapps/ && \
curl -Ls $(curl -s https://api.github.com/repos/zazukoians/LodView/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4) > lodview.war
FROM maven:3-jdk-8 AS builder
WORKDIR /app
COPY . /app
RUN mvn compile war:war

FROM tomcat:7
LABEL [email protected]
COPY --from=builder /app/target/lodview.war /usr/local/tomcat/webapps/lodview.war
CMD ["catalina.sh", "run"]
EXPOSE 8080 8009

0 comments on commit d64a560

Please sign in to comment.