Skip to content

Commit 2c9865e

Browse files
committed
improve the docker compose networks
1 parent ff19db7 commit 2c9865e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/docker-compose.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ services:
1010
- node_modules:/codecept/node_modules
1111
command: test/rest
1212
depends_on:
13-
- json_server
13+
json_server:
14+
condition: service_healthy
1415

1516
test-acceptance.webdriverio:
1617
build: ..
@@ -70,8 +71,14 @@ services:
7071
<<: *test-service
7172
entrypoint: []
7273
command: npm run json-server
73-
expose:
74-
- 8010
74+
ports:
75+
- '8010:8010' # Expose to host
76+
healthcheck:
77+
test: ['CMD', 'curl', '-f', 'http://localhost:8010/health']
78+
interval: 10s # Check every 10 seconds
79+
timeout: 5s # Timeout after 5 seconds
80+
retries: 3 # Retry 3 times before marking as unhealthy
81+
start_period: 10s # Wait 10 seconds before starting health checks
7582

7683
puppeteer-image:
7784
image: ghcr.io/puppeteer/puppeteer:22.4.1

0 commit comments

Comments
 (0)