Skip to content

Commit b852732

Browse files
committed
chore: added a healthcheck for the broker client docker compose
1 parent 17a22d0 commit b852732

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

docs/implementation-and-setup/enterprise-setup/snyk-broker/universal-broker/running-your-universal-broker-client.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,17 @@ services:
4747
      # Example: GITHUB_TOKEN, BROKER_CLIENT_VALIDATION_AUTH_HEADER, etc.
4848
    env_file:
4949
      - .env
50-
    ports:
51-
      - "${EXTERNAL_PORT_1:-8000}:${PORT:-8000}"
52-
    restart: unless-stopped
53-
54-
  snyk-broker-universal-2:
50+
ports:
51+
- "${EXTERNAL_PORT_1:-8000}:${PORT:-8000}"
52+
healthcheck:
53+
test: ["CMD", "curl", "-sf", "http://localhost:${PORT:-8000}/healthcheck"]
54+
interval: 10s
55+
timeout: 1s
56+
retries: 3
57+
start_period: 3s
58+
restart: unless-stopped
59+
60+
snyk-broker-universal-2:
5561
    image: snyk/broker:universal
5662
    environment:
5763
      DEPLOYMENT_ID: ${DEPLOYMENT_ID}
@@ -63,9 +69,15 @@ services:
6369
      GITHUB_TOKEN: ${MY_GH_TOKEN}
6470
    env_file:
6571
      - .env
66-
    ports:
67-
      - "${EXTERNAL_PORT_2:-8001}:${PORT:-8000}"
68-
    restart: unless-stopped
72+
ports:
73+
- "${EXTERNAL_PORT_2:-8001}:${PORT:-8000}"
74+
healthcheck:
75+
test: ["CMD", "curl", "-sf", "http://localhost:${PORT:-8000}/healthcheck"]
76+
interval: 10s
77+
timeout: 1s
78+
retries: 3
79+
start_period: 3s
80+
restart: unless-stopped
6981
```
7082
3. Run `docker compose up -d` to start the containers
7183

0 commit comments

Comments
 (0)