Skip to content

Commit

Permalink
Fix Dockerfile 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Hronom committed Dec 4, 2016
1 parent ab9f1b7 commit cf037e6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@ RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true
RUN apt-get install oracle-java8-installer -y
RUN apt-get install -y maven

COPY . /app
COPY texts /app/bin/texts

WORKDIR /app

RUN APP_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version|grep -Ev '(^\[|Download\w+:)')
ADD texts /app/bin/texts

# Prepare by downloading dependencies
ADD pom.xml /app/pom.xml
ADD assembly-zip.xml /app/assembly-zip.xml
RUN ["mvn", "dependency:resolve"]
RUN ["mvn", "verify"]

# Adding source, compile and package
ADD src /app/src
RUN ["mvn", "package"]

RUN mvn clean install
#ENV APP_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.2:evaluate -Dexpression=project.version|grep -Ev '(^\[|Download\w+:)')

EXPOSE 8080

WORKDIR /app/bin

ENTRYPOINT ["java", "-jar", "bin/words-counter-$APP_VERSION.jar"]
#CMD java -jar words-counter-$APP_VERSION.jar
CMD java -jar words-counter-1.1.0.jar
File renamed without changes.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
<!-- why need appendAssemblyId http://stackoverflow.com/a/20697237/285571 -->
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/zip.xml</descriptor>
<descriptor>assembly-zip.xml</descriptor>
</descriptors>
<outputDirectory>${project.basedir}/dist</outputDirectory>
</configuration>
Expand Down

0 comments on commit cf037e6

Please sign in to comment.