build: expose current jt808 docker port

This commit is contained in:
lingniu
2026-07-01 09:45:09 +08:00
parent ba1ec9a012
commit ce93236a5a
2 changed files with 11 additions and 1 deletions

View File

@@ -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"]

View File

@@ -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;