chore: decouple portainer consumer startup

This commit is contained in:
lingniu
2026-07-01 16:13:24 +08:00
parent 68253901cf
commit 2e6a982af5
2 changed files with 10 additions and 9 deletions

View File

@@ -147,10 +147,6 @@ services:
container_name: vehicle-history-app container_name: vehicle-history-app
restart: unless-stopped restart: unless-stopped
mem_limit: ${VEHICLE_HISTORY_MEM_LIMIT:-1536m} mem_limit: ${VEHICLE_HISTORY_MEM_LIMIT:-1536m}
depends_on:
- gb32960-ingest-app
- jt808-ingest-app
- yutong-mqtt-app
environment: environment:
<<: *common-env <<: *common-env
HTTP_PORT: 20200 HTTP_PORT: 20200
@@ -186,8 +182,6 @@ services:
container_name: vehicle-analytics-app container_name: vehicle-analytics-app
restart: unless-stopped restart: unless-stopped
mem_limit: ${VEHICLE_ANALYTICS_MEM_LIMIT:-1024m} mem_limit: ${VEHICLE_ANALYTICS_MEM_LIMIT:-1024m}
depends_on:
- jt808-ingest-app
environment: environment:
<<: *common-env <<: *common-env
HTTP_PORT: 20300 HTTP_PORT: 20300

View File

@@ -601,13 +601,20 @@ class PortainerComposeResourceLimitsTest {
} }
@Test @Test
void vehicleAnalyticsComposeDependsOnlyOnJt808Ingest() throws IOException { void kafkaConsumerAppsDoNotDependOnProtocolIngestContainers() throws IOException {
String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml")); String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml"));
String historyService = serviceBlock(compose, "vehicle-history-app");
String analyticsService = serviceBlock(compose, "vehicle-analytics-app"); String analyticsService = serviceBlock(compose, "vehicle-analytics-app");
assertThat(analyticsService) assertThat(historyService)
.contains(" depends_on:\n - jt808-ingest-app") .doesNotContain(" depends_on:")
.doesNotContain("- gb32960-ingest-app") .doesNotContain("- gb32960-ingest-app")
.doesNotContain("- jt808-ingest-app")
.doesNotContain("- yutong-mqtt-app");
assertThat(analyticsService)
.doesNotContain(" depends_on:")
.doesNotContain("- gb32960-ingest-app")
.doesNotContain("- jt808-ingest-app")
.doesNotContain("- yutong-mqtt-app"); .doesNotContain("- yutong-mqtt-app");
} }