Skip to content

Commit

Permalink
Added healthcheck and conditions per container (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladvildanov authored Jan 30, 2024
1 parent 4ab7de4 commit 66ef8c5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ fi

## Build infrastructure ##
docker-compose up -d
sleep 10

## Create cluster ##
docker-compose exec -T master-node "/opt/setup_cluster.sh"
Expand Down
21 changes: 19 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ services:
container_name: "master"
cap_add:
- SYS_RESOURCE
healthcheck:
test: ["CMD", "curl", "-k", "https://localhost:9443"]
interval: 5s
timeout: 2s
retries: 3
ports:
- "12000:12000"
- "9443:9443"
Expand All @@ -30,7 +35,13 @@ services:
cap_add:
- SYS_RESOURCE
depends_on:
- master-node
master-node:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-k", "https://localhost:9443"]
interval: 5s
timeout: 2s
retries: 3
ports:
- "12001:12000"
- "9444:9443"
Expand All @@ -54,7 +65,13 @@ services:
cap_add:
- SYS_RESOURCE
depends_on:
- node-1
node-1:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-k", "https://localhost:9443"]
interval: 5s
timeout: 2s
retries: 3
ports:
- "12002:12000"
- "9445:9443"
Expand Down

0 comments on commit 66ef8c5

Please sign in to comment.