Skip to content

[WIP] Add docker health checks to every service #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 65 additions & 1 deletion docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ services:
# credentials are as soon as possible, and then service credentials must
# be also updated accordingly.
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
healthcheck:
test: ["CMD", "/usr/bin/mysql", "--host=localhost", "--port=3306", "--user=root", "--password=$MYSQL_ROOT_PASSWORD", "-e", "'show databases;'"]
interval: 1m
timeout: 10s
retries: 3

groot-api-gateway:
build: groot-api-gateway
Expand All @@ -23,6 +28,11 @@ services:
volumes:
- groot_api_gateway_volume:/var/groot-api-gateway/
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000"]
interval: 1m
timeout: 10s
retries: 3

groot-credits-service:
build: groot-credits-service
Expand All @@ -32,6 +42,11 @@ services:
- db
- groot-api-gateway
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8765"]
interval: 1m
timeout: 10s
retries: 3

groot-desktop-frontend:
build: groot-desktop-frontend
Expand All @@ -40,6 +55,11 @@ services:
ports:
- "5000:5000"
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000"]
interval: 1m
timeout: 10s
retries: 3

groot-events-service:
build: groot-events-service
Expand All @@ -50,6 +70,11 @@ services:
restart: always
environment:
TZ: "America/Chicago"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8002"]
interval: 1m
timeout: 10s
retries: 3

groot-gigs-service:
build: groot-gigs-service
Expand All @@ -59,6 +84,11 @@ services:
- db
- groot-api-gateway
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8964"]
interval: 1m
timeout: 10s
retries: 3

groot-groups-service:
build: groot-groups-service
Expand All @@ -67,6 +97,11 @@ services:
depends_on:
- groot-api-gateway
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9001"]
interval: 1m
timeout: 10s
retries: 3

groot-meme-service:
build: groot-meme-service
Expand All @@ -76,6 +111,11 @@ services:
- db
- groot-api-gateway
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:42069"]
interval: 1m
timeout: 10s
retries: 3

groot-merch-service:
build: groot-merch-service
Expand All @@ -85,6 +125,11 @@ services:
- db
- groot-api-gateway
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6969"]
interval: 1m
timeout: 10s
retries: 3
environment:
RACK_ENV: "production"

Expand All @@ -96,6 +141,11 @@ services:
- db
- groot-api-gateway
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9494"]
interval: 1m
timeout: 10s
retries: 3
environment:
RACK_ENV: "production"

Expand All @@ -107,6 +157,11 @@ services:
- db
- groot-api-gateway
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 1m
timeout: 10s
retries: 3
environment:
RACK_ENV: "production"

Expand All @@ -120,6 +175,11 @@ services:
restart: always
environment:
RACK_ENV: "production"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001"]
interval: 1m
timeout: 10s
retries: 3

groot-voz:
build: groot-voz
Expand All @@ -129,7 +189,11 @@ services:
- db
- groot-api-gateway
restart: always

healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5652"]
interval: 1m
timeout: 10s
retries: 3
volumes:
db_data:
groot_api_gateway_volume:
70 changes: 70 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ services:
restart: always
environment:
MYSQL_ROOT_PASSWORD: "root"
healthcheck:
test: ["CMD", "/usr/bin/mysql", "--host=localhost", "--port=3306", "--user=root", "--password=$MYSQL_ROOT_PASSWORD", "-e", "'show databases;'"]
interval: 1m
timeout: 10s
retries: 3

groot-api-gateway:
build: groot-api-gateway
Expand All @@ -19,6 +24,11 @@ services:
- groot_api_gateway_volume:/var/groot-api-gateway/
command: ["./build/groot-api-gateway", "-u"]
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000"]
interval: 1m
timeout: 10s
retries: 3

groot-auth-stub-service:
build: groot-auth-stub-service
Expand All @@ -27,6 +37,11 @@ services:
volumes:
- ./groot-auth-stub-service:/usr/src/app
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8008"]
interval: 1m
timeout: 10s
retries: 3

groot-credits-service:
build: groot-credits-service
Expand All @@ -40,6 +55,11 @@ services:
environment:
CREDITS_DEBUG: "True"
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8765"]
interval: 1m
timeout: 10s
retries: 3

groot-desktop-frontend:
build: groot-desktop-frontend
Expand All @@ -50,6 +70,11 @@ services:
volumes:
- ./groot-desktop-frontend:/usr/src/app
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000"]
interval: 1m
timeout: 10s
retries: 3

groot-events-service:
build: groot-events-service
Expand All @@ -62,6 +87,11 @@ services:
restart: always
environment:
TZ: "America/Chicago"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8002"]
interval: 1m
timeout: 10s
retries: 3

groot-gigs-service:
build: groot-gigs-service
Expand All @@ -75,6 +105,11 @@ services:
environment:
GIG_DEBUG: "True"
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8964"]
interval: 1m
timeout: 10s
retries: 3

groot-groups-service:
build: groot-groups-service
Expand All @@ -85,6 +120,11 @@ services:
volumes:
- ./groot-groups-service:/usr/src/app
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9001"]
interval: 1m
timeout: 10s
retries: 3

groot-meme-service:
build: groot-meme-service
Expand All @@ -98,6 +138,11 @@ services:
environment:
MEME_DEBUG: "True"
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:42069"]
interval: 1m
timeout: 10s
retries: 3

groot-merch-service:
build: groot-merch-service
Expand All @@ -109,6 +154,11 @@ services:
volumes:
- ./groot-merch-service:/usr/src/app
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6969"]
interval: 1m
timeout: 10s
retries: 3

groot-quotes-service:
build: groot-quotes-service
Expand All @@ -120,6 +170,11 @@ services:
volumes:
- ./groot-quotes-service:/usr/src/app
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9494"]
interval: 1m
timeout: 10s
retries: 3

groot-recruiters-service:
build: groot-recruiters-service
Expand All @@ -131,6 +186,11 @@ services:
volumes:
- ./groot-recruiters-service:/usr/src/app
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4567"]
interval: 1m
timeout: 10s
retries: 3

groot-users-service:
build: groot-users-service
Expand All @@ -142,6 +202,11 @@ services:
volumes:
- ./groot-users-service:/usr/src/app
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001"]
interval: 1m
timeout: 10s
retries: 3

groot-voz:
build: groot-voz
Expand All @@ -155,6 +220,11 @@ services:
environment:
VOZ_DEBUG: "True"
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5652"]
interval: 1m
timeout: 10s
retries: 3

volumes:
db_data:
Expand Down