Skip to content
Permalink
Browse files

Optimize dockerfile

  • Loading branch information...
selevit committed Nov 20, 2016
1 parent 7a31766 commit f3d7ca782e8401bdcb47c1a78b73652870ebf701
Showing with 15 additions and 18 deletions.
  1. +0 −3 .travis.yml
  2. +15 −15 wiki-bot/Dockerfile
@@ -9,9 +9,6 @@ services:
cache:
directories:
- $HOME/.cache/pip
- /var/lib/docker/image
- /var/lib/docker/containers
- /var/lib/docker/aufs

env:
SSL_KEY: nginx.key
@@ -1,26 +1,26 @@
FROM java:latest
FROM java:8-alpine
MAINTAINER Mike Shemanskiy <mike.shemanskiy@gmail.com>

RUN mkdir bot
ADD src /bot/src
ADD pom.xml /bot

RUN wget http://ftp.fau.de/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
RUN tar -zxvf apache-maven-3.3.9-bin.tar.gz
RUN rm apache-maven-3.3.9-bin.tar.gz
RUN mv apache-maven-3.3.9 /usr/lib/mvn

ENV M2_HOME=/usr/lib/mvn
ENV M2=$M2_HOME/bin
ENV PATH $PATH:$JAVA_HOME:$JAVA:$M2_HOME:$M2

RUN cd /bot \
&& mvn package \
&& mv target/rtbot-0.0.1-SNAPSHOT.jar . \
&& rm -r target src pom.xml /usr/lib/mvn
ADD http://ftp.fau.de/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz /tmp/

RUN cd /tmp/ && \
tar -zxvf apache-maven-3.3.9-bin.tar.gz && \
rm apache-maven-3.3.9-bin.tar.gz && \
mv apache-maven-3.3.9 /usr/lib/mvn && \
rm -rf /tmp/* && \
mkdir -p /bot

ADD . /src
WORKDIR /bot

RUN cd /src/ && mvn -q package \
&& mv target/rtbot-0.0.1-SNAPSHOT.jar /bot \
&& rm -rf /src /usr/lib/mvn /tmp/*

EXPOSE 8080

CMD ["java", "-jar", "rtbot-0.0.1-SNAPSHOT.jar"]
CMD ["java", "-jar", "rtbot-0.0.1-SNAPSHOT.jar"]

0 comments on commit f3d7ca7

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.