diff --git a/Dockerfile b/Dockerfile index 9288b003..2e5554d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,6 @@ ENV JAVA_OPTS="" WORKDIR /app COPY modules/apps/${APP_NAME}/target/${APP_NAME}.jar /app/app.jar -EXPOSE 20100 20200 20300 20400 20500 32960 10808 +EXPOSE 20100 20200 20300 20400 20500 32960 808 ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /app/app.jar"] diff --git a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/WoodpeckerPipelineTest.java b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/WoodpeckerPipelineTest.java index 367b41a9..b484d0e3 100644 --- a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/WoodpeckerPipelineTest.java +++ b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/WoodpeckerPipelineTest.java @@ -23,6 +23,16 @@ class WoodpeckerPipelineTest { assertThat(countOccurrences(pipeline, "- name: docker-build-")).isEqualTo(1); } + @Test + void dockerImageExposesOnlyCurrentProductionPorts() throws IOException { + String dockerfile = Files.readString(repositoryRoot().resolve("Dockerfile")); + + assertThat(dockerfile) + .contains("EXPOSE 20100 20200 20300 20400 20500 32960 808") + .doesNotContain("10808") + .doesNotContain("8089"); + } + private static int countOccurrences(String value, String needle) { int count = 0; int from = 0;