From 2c9865e7c312f3e4bebfba01e12251ca0a47efab Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Thu, 9 Jan 2025 15:33:18 +0100 Subject: [PATCH 1/3] improve the docker compose networks --- test/docker-compose.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 03f91bc31..e04ac143a 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -10,7 +10,8 @@ services: - node_modules:/codecept/node_modules command: test/rest depends_on: - - json_server + json_server: + condition: service_healthy test-acceptance.webdriverio: build: .. @@ -70,8 +71,14 @@ services: <<: *test-service entrypoint: [] command: npm run json-server - expose: - - 8010 + ports: + - '8010:8010' # Expose to host + healthcheck: + test: ['CMD', 'curl', '-f', 'http://localhost:8010/health'] + interval: 10s # Check every 10 seconds + timeout: 5s # Timeout after 5 seconds + retries: 3 # Retry 3 times before marking as unhealthy + start_period: 10s # Wait 10 seconds before starting health checks puppeteer-image: image: ghcr.io/puppeteer/puppeteer:22.4.1 From f4f5d1afe20f1915b00d0d266b527adb69abfbc8 Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Thu, 9 Jan 2025 15:43:21 +0100 Subject: [PATCH 2/3] improve the docker compose networks --- test/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/docker-compose.yml b/test/docker-compose.yml index e04ac143a..c0b737f45 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -79,6 +79,7 @@ services: timeout: 5s # Timeout after 5 seconds retries: 3 # Retry 3 times before marking as unhealthy start_period: 10s # Wait 10 seconds before starting health checks + restart: always # Automatically restart the container if it fails or becomes unhealthy puppeteer-image: image: ghcr.io/puppeteer/puppeteer:22.4.1 From 18797271c2b511c0eb713411de03d3ff1d6b93be Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Thu, 9 Jan 2025 15:49:50 +0100 Subject: [PATCH 3/3] improve the docker compose networks --- test/docker-compose.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/docker-compose.yml b/test/docker-compose.yml index c0b737f45..6537b5069 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -10,8 +10,7 @@ services: - node_modules:/codecept/node_modules command: test/rest depends_on: - json_server: - condition: service_healthy + - json_server test-acceptance.webdriverio: build: .. @@ -73,12 +72,6 @@ services: command: npm run json-server ports: - '8010:8010' # Expose to host - healthcheck: - test: ['CMD', 'curl', '-f', 'http://localhost:8010/health'] - interval: 10s # Check every 10 seconds - timeout: 5s # Timeout after 5 seconds - retries: 3 # Retry 3 times before marking as unhealthy - start_period: 10s # Wait 10 seconds before starting health checks restart: always # Automatically restart the container if it fails or becomes unhealthy puppeteer-image: