зеркало из https://github.com/Azure/draft-classic.git
Merge pull request #142 from fiunchinho/feature/improve_maven_dockerfile
Using multi-stage to compile the application
This commit is contained in:
Коммит
a2cacc6418
|
@ -1,3 +1,10 @@
|
|||
FROM maven:onbuild
|
||||
FROM maven:3.5-jdk-8-alpine as BUILD
|
||||
|
||||
COPY . /usr/src/app
|
||||
RUN mvn -f /usr/src/app/pom.xml clean package
|
||||
|
||||
FROM openjdk:8-jdk-alpine
|
||||
EXPOSE 4567
|
||||
CMD ["java", "-jar", "target/helloworld-jar-with-dependencies.jar"]
|
||||
COPY --from=BUILD /usr/src/app/target/*.jar /opt/app.jar
|
||||
WORKDIR /opt
|
||||
CMD ["java", "-jar", "app.jar"]
|
||||
|
|
Загрузка…
Ссылка в новой задаче