- docker-entrypoint.sh: `web` (default) or `worker`; both apply pending migrations under a flock on /data, so no start-order dependency - docker-healthcheck.sh baked into the image for both roles - deploy/compose.yaml reduced to image, role, env file, volumes, port - dist/migrate.mjs bundled alongside the worker Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 lines
411 B
Bash
9 lines
411 B
Bash
#!/bin/sh
|
|
# Healthcheck for both roles (see docker-entrypoint.sh).
|
|
case "$(cat /tmp/kaname-role 2>/dev/null)" in
|
|
# The worker touches this file on every heartbeat (every 5s).
|
|
worker) find /tmp/kaname-worker-alive -mmin -1 | grep -q . ;;
|
|
web) node -e 'fetch("http://127.0.0.1:" + (process.env.PORT || 3000) + "/login").then((r) => process.exit(r.ok ? 0 : 1), () => process.exit(1))' ;;
|
|
*) exit 0 ;;
|
|
esac
|