Skip to content

A single container ​

Use this when PostgreSQL and Redis already exist: a managed service, or servers you run. The server is one container with one volume.

Start it ​

sh
docker run -d --name joobqui --restart unless-stopped \
  -p 127.0.0.1:4000:4000 -v joobqui-data:/data \
  --read-only --tmpfs /tmp:size=16m,noexec,nosuid --cap-drop ALL --security-opt no-new-privileges \
  --init --stop-timeout 60 \
  ghcr.io/azutoolkit/joobqui-selfhosted:vX.Y.Z
docker logs joobqui     # the one-time setup code

Then finish the setup page: it asks for the public address, the licence sign-in, Redis and PostgreSQL. Put a TLS proxy in front of port 4000 first.

The image runs as UID 10001, listens on port 4000 (PORT), sets CRYSTAL_ENV=production and checks its own health with GET /healthz.

Give it the connections yourself ​

Any setting the environment sets is not asked for on the setup page, cannot be changed in the console (it is shown as set by environment), and wins over a saved value. This is how a deployment keeps a value in its own secret manager:

sh
docker run -d --name joobqui --restart unless-stopped \
  -p 127.0.0.1:4000:4000 -v joobqui-data:/data \
  -v "$PWD/secrets:/run/secrets:ro" \
  -e DATABASE_URL_FILE=/run/secrets/database_url \
  -e REDIS_URL_FILE=/run/secrets/redis_url \
  -e JOOBQUI_PUBLIC_URL=https://jobs.example.com \
  ghcr.io/azutoolkit/joobqui-selfhosted:vX.Y.Z

NAME_FILE reads a value from a file, for DATABASE_URL, REDIS_URL, SESSION_SECRET, JOOBQUI_SDK_TOKEN and JOOBQUI_ENROLLMENT_TOKEN. The files must be readable by UID 10001.

ConnectionForms
PostgreSQLDATABASE_URL=postgres://user:password@host:5432/database
RedisREDIS_URL=redis://[user:password@]host:6379[/db], rediss:// for TLS, unix:///path.sock; or REDIS_HOST, REDIS_PORT, REDIS_PASS

Over TLS the server checks Redis's certificate chain and that it was issued for the host you connect to (a DNS or IP address in the certificate); REDIS_CA_FILE adds a CA of your own to the system's. The secrets the server would generate can be given too (SESSION_SECRET, JOOBQUI_SECRETS_KEY, JOOBQUI_PAYLOAD_KEYS): then keep them, since they are no longer in /data. See Secrets.

Without a container runtime ​

The image holds one static binary and its files in /app: joobqui-selfhosted, public/ (the console) and config/. Run it from that directory, as an unprivileged user, with JOOBQUI_DATA_DIR pointing at a directory only that user can read. Stop it with SIGTERM and give it 25 seconds or more before a kill.

Check it worked ​

sh
docker exec joobqui ./joobqui doctor
curl -fsS https://jobs.example.com/healthz

Health checks ​

ProbeAnswersChecks
GET /healthz200 {"status":"ok"}The process answers; nothing else
GET /readyz200 {"status":"ok"}, or 503 {"status":"unavailable","checks":{"redis":"ok","database":"fail"}}Redis, PostgreSQL and that the migrations are applied

Both are public, work with a lapsed licence, and show no error text, host or version. /readyz caches its answer for a second and gives each check 500 ms. While the setup page is showing, /healthz is 200 and /readyz is 503 {"status":"setup_required"}. A --worker process listens on no port, so it has no probe.

The image's HEALTHCHECK, the Compose file and Fly use /healthz: it must pass during setup and must not mark the container unhealthy when Redis or PostgreSQL is down, or a first-run server would never be routed to. Point a load balancer or a Kubernetes readiness probe at /readyz:

yaml
livenessProbe:
  httpGet: {path: /healthz, port: 4000}
  periodSeconds: 15
readinessProbe:
  httpGet: {path: /readyz, port: 4000}
  periodSeconds: 5
startupProbe:            # the migrations run before the server listens: allow up to 5 minutes
  httpGet: {path: /healthz, port: 4000}
  periodSeconds: 5
  failureThreshold: 60