Skip to content

⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.

fix: add healthchecks to the deployed services (#46)

Croffc78694a6c72a
diff --git a/docker-compose.coolify.yml b/docker-compose.coolify.yml
index e1c5d5c0..2f622e28 100644
--- a/docker-compose.coolify.yml
+++ b/docker-compose.coolify.yml
@@ -7,6 +7,12 @@
# SERVICE_PASSWORD_* / SERVICE_URL_* are Coolify magic variables: generated and
# persisted on first deploy, stable across deploys. SERVICE_URL_* come from the
# Domains fields, so the public URLs live in one place.
+#
+# Coolify reports the worst container health as the resource status, so a service
+# without a healthcheck holds the whole stack at "running (unknown)". Services that
+# answer no requests are taken out of that aggregate with `exclude_from_hc: true`
+# (a Coolify key, stripped before compose runs) or, for one-shot containers, by
+# `restart: 'no'`, which it treats the same way.
# ─────────────────────────────────────────────────────────────
services:
postgres:
@@ -37,6 +43,12 @@ services:
MINIO_ROOT_PASSWORD: ${SERVICE_PASSWORD_MINIO}
volumes:
- minio-data:/data
+ healthcheck:
+ test: ['CMD', 'mc', 'ready', 'local']
+ interval: 15s
+ timeout: 5s
+ retries: 5
+ start_period: 20s
# One-shot: waits for MinIO, creates the attachments bucket, then exits.
# restart "no" is explicit: it exits 0 by design, and platforms that inject
@@ -89,17 +101,25 @@ services:
S3_ACCESS_KEY_ID: ${SERVICE_USER_MINIO}
S3_SECRET_ACCESS_KEY: ${SERVICE_PASSWORD_MINIO}
S3_REGION: ${S3_REGION:-us-east-1}
+ # start_period covers the migrations the container applies before it listens.
+ healthcheck:
+ test: ['CMD', 'wget', '-q', '-O', '/dev/null', 'http://127.0.0.1:3000/']
+ interval: 15s
+ timeout: 5s
+ retries: 5
+ start_period: 90s
# Set API_PORT in Coolify if 3000 is taken on the host.
ports:
- '${API_PORT:-3000}:3000'
# Background worker for webhook delivery, agent schedules, and autonomous agent
- # runs. Shares the database with the api. No public ports.
+ # runs. Shares the database with the api. No public ports, so nothing to probe.
worker:
build:
context: .
dockerfile: apps/worker/Dockerfile
restart: unless-stopped
+ exclude_from_hc: true
depends_on:
postgres:
condition: service_healthy
@@ -133,6 +153,7 @@ services:
context: .
dockerfile: apps/bot/Dockerfile
restart: unless-stopped
+ exclude_from_hc: true
depends_on:
api:
condition: service_started
@@ -163,6 +184,13 @@ services:
NODE_ENV: production
PORT: 3001
HOSTNAME: 0.0.0.0
+ # /login renders without a session, and without reaching the api.
+ healthcheck:
+ test: ['CMD', 'wget', '-q', '-O', '/dev/null', 'http://127.0.0.1:3001/login']
+ interval: 15s
+ timeout: 5s
+ retries: 5
+ start_period: 20s
# Set WEB_PORT in Coolify if 3001 is taken on the host.
ports:
- '${WEB_PORT:-3001}:3001'
diff --git a/docker-compose.yml b/docker-compose.yml
index ef7bd9b4..c497c68e 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -47,6 +47,12 @@ services:
MINIO_ROOT_PASSWORD: ${S3_SECRET_ACCESS_KEY:?set S3_SECRET_ACCESS_KEY in .env}
volumes:
- minio-data:/data
+ healthcheck:
+ test: ['CMD', 'mc', 'ready', 'local']
+ interval: 15s
+ timeout: 5s
+ retries: 5
+ start_period: 20s
# One-shot: waits for MinIO, creates the attachments bucket, then exits.
minio-init:
@@ -98,6 +104,13 @@ services:
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
S3_REGION: ${S3_REGION:-us-east-1}
+ # start_period covers the migrations the container applies before it listens.
+ healthcheck:
+ test: ['CMD', 'wget', '-q', '-O', '/dev/null', 'http://127.0.0.1:3000/']
+ interval: 15s
+ timeout: 5s
+ retries: 5
+ start_period: 90s
ports:
- '${API_PORT:-3000}:3000'
@@ -163,6 +176,13 @@ services:
NODE_ENV: production
PORT: 3001
HOSTNAME: 0.0.0.0
+ # /login renders without a session, and without reaching the api.
+ healthcheck:
+ test: ['CMD', 'wget', '-q', '-O', '/dev/null', 'http://127.0.0.1:3001/login']
+ interval: 15s
+ timeout: 5s
+ retries: 5
+ start_period: 20s
ports:
- '${WEB_PORT:-3001}:3001'