diff --git a/spring-petclinic-admin-server/src/main/docker/Dockerfile b/docker/Dockerfile similarity index 93% rename from spring-petclinic-admin-server/src/main/docker/Dockerfile rename to docker/Dockerfile index 0ca5d565a..68603a51a 100644 --- a/spring-petclinic-admin-server/src/main/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,5 +6,5 @@ ARG ARTIFACT_NAME ADD ${ARTIFACT_NAME}.jar /app.jar ENV SPRING_PROFILES_ACTIVE docker RUN bash -c 'touch /app.jar' -EXPOSE 9090 +EXPOSE ${EXPOSED_PORT} ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] diff --git a/pom.xml b/pom.xml index 270906815..397bb32ab 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,8 @@ 1.8 mszarlinski + 9090 + ${basedir} 0.4.13 @@ -125,6 +127,44 @@ + + + buildDocker + + + + + com.spotify + docker-maven-plugin + ${docker.plugin.version} + + + install + + build + + + + + ${docker.image.prefix}/${project.artifactId} + ${docker.image.dockerfile.dir} + + + / + ${project.build.directory} + ${project.build.finalName}.jar + + + + ${project.build.finalName} + ${docker.image.exposed.port} + + + + + + + diff --git a/spring-petclinic-admin-server/pom.xml b/spring-petclinic-admin-server/pom.xml index 816494256..e73946fdd 100644 --- a/spring-petclinic-admin-server/pom.xml +++ b/spring-petclinic-admin-server/pom.xml @@ -17,6 +17,8 @@ 1.5.6 + 9090 + ${basedir}/../docker @@ -63,28 +65,6 @@ com.spotify docker-maven-plugin ${docker.plugin.version} - - - install - - build - - - - - ${docker.image.prefix}/${project.artifactId} - ${project.basedir}/src/main/docker - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - - ${project.build.finalName} - - diff --git a/spring-petclinic-api-gateway/pom.xml b/spring-petclinic-api-gateway/pom.xml index cfaf6731b..b7524d045 100644 --- a/spring-petclinic-api-gateway/pom.xml +++ b/spring-petclinic-api-gateway/pom.xml @@ -21,6 +21,8 @@ 1.6.4 1.0.3 1.8.0 + 8081 + ${basedir}/../docker @@ -149,28 +151,6 @@ com.spotify docker-maven-plugin ${docker.plugin.version} - - - install - - build - - - - - ${docker.image.prefix}/${project.artifactId} - ${project.basedir}/src/main/docker - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - - ${project.build.finalName} - - diff --git a/spring-petclinic-api-gateway/src/main/docker/Dockerfile b/spring-petclinic-api-gateway/src/main/docker/Dockerfile deleted file mode 100644 index 6a0e3ea77..000000000 --- a/spring-petclinic-api-gateway/src/main/docker/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM java:8 -VOLUME /tmp -ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh wait-for-it.sh -RUN bash -c 'chmod +x wait-for-it.sh' -ARG ARTIFACT_NAME -ADD ${ARTIFACT_NAME}.jar /app.jar -ENV SPRING_PROFILES_ACTIVE docker -RUN bash -c 'touch /app.jar' -EXPOSE 8081 -ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] diff --git a/spring-petclinic-config-server/pom.xml b/spring-petclinic-config-server/pom.xml index 1c68bda8f..c2c3fc537 100644 --- a/spring-petclinic-config-server/pom.xml +++ b/spring-petclinic-config-server/pom.xml @@ -14,6 +14,11 @@ 1.5.9 + + 8888 + ${basedir}/../docker + + @@ -45,28 +50,6 @@ com.spotify docker-maven-plugin ${docker.plugin.version} - - - install - - build - - - - - ${docker.image.prefix}/${project.artifactId} - ${project.basedir}/src/main/docker - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - - ${project.build.finalName} - - diff --git a/spring-petclinic-config-server/src/main/docker/Dockerfile b/spring-petclinic-config-server/src/main/docker/Dockerfile deleted file mode 100644 index 5c1c7f44e..000000000 --- a/spring-petclinic-config-server/src/main/docker/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM java:8 -VOLUME /tmp -ARG ARTIFACT_NAME -ADD ${ARTIFACT_NAME}.jar /app.jar -RUN bash -c 'touch /app.jar' -EXPOSE 8888 -ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] diff --git a/spring-petclinic-customers-service/pom.xml b/spring-petclinic-customers-service/pom.xml index b7d380abe..98dee2852 100644 --- a/spring-petclinic-customers-service/pom.xml +++ b/spring-petclinic-customers-service/pom.xml @@ -14,6 +14,11 @@ 1.5.9 + + 8081 + ${basedir}/../docker + + @@ -94,28 +99,6 @@ com.spotify docker-maven-plugin ${docker.plugin.version} - - - install - - build - - - - - ${docker.image.prefix}/${project.artifactId} - ${project.basedir}/src/main/docker - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - - ${project.build.finalName} - - diff --git a/spring-petclinic-customers-service/src/main/docker/Dockerfile b/spring-petclinic-customers-service/src/main/docker/Dockerfile deleted file mode 100644 index 6a0e3ea77..000000000 --- a/spring-petclinic-customers-service/src/main/docker/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM java:8 -VOLUME /tmp -ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh wait-for-it.sh -RUN bash -c 'chmod +x wait-for-it.sh' -ARG ARTIFACT_NAME -ADD ${ARTIFACT_NAME}.jar /app.jar -ENV SPRING_PROFILES_ACTIVE docker -RUN bash -c 'touch /app.jar' -EXPOSE 8081 -ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] diff --git a/spring-petclinic-discovery-server/pom.xml b/spring-petclinic-discovery-server/pom.xml index b71f3e112..ea0c04f86 100644 --- a/spring-petclinic-discovery-server/pom.xml +++ b/spring-petclinic-discovery-server/pom.xml @@ -14,6 +14,11 @@ 1.5.9 + + 8761 + ${basedir}/../docker + + @@ -43,28 +48,6 @@ com.spotify docker-maven-plugin ${docker.plugin.version} - - - install - - build - - - - - ${docker.image.prefix}/${project.artifactId} - ${project.basedir}/src/main/docker - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - - ${project.build.finalName} - - diff --git a/spring-petclinic-discovery-server/src/main/docker/Dockerfile b/spring-petclinic-discovery-server/src/main/docker/Dockerfile deleted file mode 100644 index 996138d0c..000000000 --- a/spring-petclinic-discovery-server/src/main/docker/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM java:8 -VOLUME /tmp -ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh wait-for-it.sh -RUN bash -c 'chmod +x wait-for-it.sh' -ARG ARTIFACT_NAME -ADD ${ARTIFACT_NAME}.jar /app.jar -ENV SPRING_PROFILES_ACTIVE docker -RUN bash -c 'touch /app.jar' -EXPOSE 8761 -ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] diff --git a/spring-petclinic-tracing-server/pom.xml b/spring-petclinic-tracing-server/pom.xml index efeec6dfb..df1cb6f05 100644 --- a/spring-petclinic-tracing-server/pom.xml +++ b/spring-petclinic-tracing-server/pom.xml @@ -15,6 +15,11 @@ 1.5.9 + + 8081 + ${basedir}/../docker + + @@ -63,28 +68,6 @@ com.spotify docker-maven-plugin ${docker.plugin.version} - - - install - - build - - - - - ${docker.image.prefix}/${project.artifactId} - ${project.basedir}/src/main/docker - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - - ${project.build.finalName} - - diff --git a/spring-petclinic-tracing-server/src/main/docker/Dockerfile b/spring-petclinic-tracing-server/src/main/docker/Dockerfile deleted file mode 100644 index 6a0e3ea77..000000000 --- a/spring-petclinic-tracing-server/src/main/docker/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM java:8 -VOLUME /tmp -ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh wait-for-it.sh -RUN bash -c 'chmod +x wait-for-it.sh' -ARG ARTIFACT_NAME -ADD ${ARTIFACT_NAME}.jar /app.jar -ENV SPRING_PROFILES_ACTIVE docker -RUN bash -c 'touch /app.jar' -EXPOSE 8081 -ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] diff --git a/spring-petclinic-vets-service/pom.xml b/spring-petclinic-vets-service/pom.xml index 1ffc4e72c..c2ea35252 100644 --- a/spring-petclinic-vets-service/pom.xml +++ b/spring-petclinic-vets-service/pom.xml @@ -14,6 +14,11 @@ 1.5.9 + + 8081 + ${basedir}/../docker + + @@ -101,28 +106,6 @@ com.spotify docker-maven-plugin ${docker.plugin.version} - - - install - - build - - - - - ${docker.image.prefix}/${project.artifactId} - ${project.basedir}/src/main/docker - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - - ${project.build.finalName} - - diff --git a/spring-petclinic-vets-service/src/main/docker/Dockerfile b/spring-petclinic-vets-service/src/main/docker/Dockerfile deleted file mode 100644 index 6a0e3ea77..000000000 --- a/spring-petclinic-vets-service/src/main/docker/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM java:8 -VOLUME /tmp -ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh wait-for-it.sh -RUN bash -c 'chmod +x wait-for-it.sh' -ARG ARTIFACT_NAME -ADD ${ARTIFACT_NAME}.jar /app.jar -ENV SPRING_PROFILES_ACTIVE docker -RUN bash -c 'touch /app.jar' -EXPOSE 8081 -ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] diff --git a/spring-petclinic-visits-service/pom.xml b/spring-petclinic-visits-service/pom.xml index 3d30189f6..2e44cadf5 100644 --- a/spring-petclinic-visits-service/pom.xml +++ b/spring-petclinic-visits-service/pom.xml @@ -14,6 +14,11 @@ 1.5.9 + + 8081 + ${basedir}/../docker + + @@ -83,28 +88,6 @@ com.spotify docker-maven-plugin ${docker.plugin.version} - - - install - - build - - - - - ${docker.image.prefix}/${project.artifactId} - ${project.basedir}/src/main/docker - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - - ${project.build.finalName} - - diff --git a/spring-petclinic-visits-service/src/main/docker/Dockerfile b/spring-petclinic-visits-service/src/main/docker/Dockerfile deleted file mode 100644 index 6a0e3ea77..000000000 --- a/spring-petclinic-visits-service/src/main/docker/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM java:8 -VOLUME /tmp -ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh wait-for-it.sh -RUN bash -c 'chmod +x wait-for-it.sh' -ARG ARTIFACT_NAME -ADD ${ARTIFACT_NAME}.jar /app.jar -ENV SPRING_PROFILES_ACTIVE docker -RUN bash -c 'touch /app.jar' -EXPOSE 8081 -ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]