Skip to content

Commit 845e2d1

Browse files
committed
devops: Improve health check for studio
1 parent 67795ae commit 845e2d1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

docker-compose.supabase_docker.customise.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,19 @@ services:
7676
# does *NOT* listen to, as it binds to the exposed interface only!!
7777
# Use the docker lookup of studio to the assigned IP address instead.
7878
healthcheck:
79+
# Increase timeout for beign able to do first time install of curl.
80+
timeout: 10s
81+
interval: 15s
82+
retries: 3
7983
test:
84+
# Use bash script for efficient health checking:
85+
# 1. Avoids loading Node.js which was causing high I/O
86+
# 2. Installs curl only if needed (first run)
87+
# 3. Uses lightweight curl for subsequent health checks
88+
# 4. Uses internal Docker DNS resolution with 'studio' hostname
8089
[
8190
"CMD",
82-
"node",
83-
"-e",
84-
"require('http').get('http://studio:3000/api/profile', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})",
91+
"/bin/bash",
92+
"-c",
93+
"which curl || (apt-get update && apt-get install -y curl) && curl -f http://studio:3000/api/profile || exit 1",
8594
]

0 commit comments

Comments
 (0)