Add Phase 1 task decisions documentation for db-init runner, positions table divergences, and Gitea CI workflow

This commit is contained in:
2026-05-02 12:23:06 +02:00
parent f9b96efc6b
commit 130b44778a
5 changed files with 126 additions and 8 deletions
@@ -1,16 +1,24 @@
---
name: TimescaleDB-HA Docker image facts
description: Key facts about timescale/timescaledb-ha needed for compose and CI configuration
description: Empirically verified facts about timescale/timescaledb-ha used in TRM compose files
type: reference
---
# TimescaleDB-HA Docker image facts
- **Image used**: `timescale/timescaledb-ha:pg16-latest`
- **PostGIS**: Included by default in all (non-oss) tags. The `-oss` suffix variants ship only OSS-licensed extensions (PostGIS is Apache-licensed, included even in `-oss`). The GitHub README confirms: "By default, the Docker image contains many extensions, including TimescaleDB and PostGIS."
- **`-all` suffix meaning**: Contains multiple Postgres major versions in one image (e.g. pg13+pg14+pg15). NOT about extra extensions. Not needed for TRM.
- **PGDATA directory**: `/pgdata` — set via `PGDATA=/pgdata` env var. NOT the standard `/var/lib/postgresql/data`. Volume mounts must target `/pgdata`.
**CORRECTED after task 1.1 live boot (2026-05-01).**
- **Image pinned in TRM**: `timescale/timescaledb-ha:pg16.6-ts2.17.2-all`
- `:pg16-latest` does NOT exist on Docker Hub — it 404s at pull time.
- The `-all` suffix here means "all extensions bundled" (TimescaleDB + PostGIS + more), NOT "all PG versions".
- Always pin a concrete `pgX.Y-tsA.B.C-all` tag; floating tags are unreliable for this image.
- **PGDATA directory**: `/home/postgres/pgdata/data`
- NOT `/pgdata`, NOT `/var/lib/postgresql/data`.
- Setting `PGDATA=/pgdata` and mounting a volume to `/pgdata` causes initdb to fail with "could not change permissions of directory".
- compose.dev.yaml correctly sets `PGDATA: /home/postgres/pgdata/data` and mounts to the same path.
- **PostGIS**: Binaries are bundled in the `-all` image but the extension is NOT auto-created on user databases.
- Directus logs a benign warning: `PostGIS isn't installed. Geometry type support will be limited.`
- Must be created explicitly: `CREATE EXTENSION IF NOT EXISTS postgis;` — lands in db-init Phase 2.
- **Environment variables**: `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB` (same as official postgres image).
- **Healthcheck**: `pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB` (double-$ in compose YAML to escape interpolation; the container sees single $ at runtime).
- **Compatible with `CREATE EXTENSION postgis`**: Yes, binaries present.
- **Compatible with `CREATE EXTENSION timescaledb`**: Yes, it's the whole point of the image.
- **Healthcheck**: `pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB` (double-$ in compose YAML to escape interpolation).
- **`psql` / `pg_isready` in the Directus container**: Installed via `apk add --no-cache postgresql16-client` in the Dockerfile (task 1.1). Available on PATH at runtime.