Compute the dataset names in the compose, with no overridable wrapper

The sibling apps wrap their dataset names in an overridable
`${MAIN_DATASET:-${DATASET_PREFIX:-…}-${SERVICE_NAME_BACKEND}}` because they keep
historical datasets. Coolify stores such a default, itself an expression, as the
created variable's value, so the new app showed MAIN_DATASET and
SETTINGS_DATASET holding what reads as unresolved text. It does resolve at
deploy time (docker compose interpolates `.env` values), so this was confusing
rather than broken — but Festipod has no historical datasets to keep, so the
names are now computed directly: festipod-backend / settings-festipod-backend,
`…-backend-pr-<n>` in a preview, the same names as before.

The comment and the deployment leaf say what was observed and what was traced,
and that a second stack on the same Fuseki needs its own DATASET_PREFIX in both
its normal and preview scopes.
This commit is contained in:
Sylvain Duchesne
2026-10-19 17:44:51 +02:00
parent a28a318c24
commit 5b61ce9905
2 changed files with 11 additions and 6 deletions
@@ -8,7 +8,7 @@ last_checked: 2026-10-19
## The Coolify test stack
`docker-compose.coolify.yml` is what Coolify (build pack *Docker Compose*) builds and runs from the git repository, on the test server only for now: `frontend` (the root `Dockerfile`, below), `backend` (`backend/Dockerfile`, Moleculer + `@activitypods/app`) and a per-stack Redis. Fuseki is the one shared with the other ActivityPods apps of the Coolify instance (`shared-infra`): only the backend joins the external `coolify` network to reach it, with a pair of datasets of its own named from `DATASET_PREFIX` and the backend's service name (a second non-preview stack on the same Fuseki needs its own prefix). The variables Coolify must carry are listed at the top of the compose file; `SERVICE_FQDN_*` / `SERVICE_NAME_*` are generated by Coolify.
`docker-compose.coolify.yml` is what Coolify (build pack *Docker Compose*) builds and runs from the git repository, on the test server only for now: `frontend` (the root `Dockerfile`, below), `backend` (`backend/Dockerfile`, Moleculer + `@activitypods/app`) and a per-stack Redis. Fuseki is the one shared with the other ActivityPods apps of the Coolify instance (`shared-infra`): only the backend joins the external `coolify` network to reach it, with a pair of datasets of its own named from `DATASET_PREFIX` and the backend's service name (a second non-preview stack on the same Fuseki needs its own prefix). The variables Coolify must carry are listed at the top of the compose file; `SERVICE_FQDN_*` / `SERVICE_NAME_*` are generated by Coolify, the latter only at deploy time (stored empty). **A compose value starting with `${VAR:-default}` makes Coolify create `VAR` with the default text as its stored value** (when the variable does not exist yet; the preview scope gets its own copy at creation). A default that is itself an expression — the sibling apps' `${MAIN_DATASET:-${DATASET_PREFIX:-…}-${SERVICE_NAME_BACKEND}}` override — is therefore stored as expression text: it READS as unresolved in Coolify's UI (observed 2026-10-19), yet works, since Coolify writes it unescaped into the `.env` after the `SERVICE_NAME_*` lines and docker compose resolves `${…}` inside `.env` values (verified with compose; the Coolify side traced in its 4.4.6 source, not observed live). Festipod has no historical datasets to keep, so it computes the names directly and carries no such misleading variable.
**One base URL per environment** (user decision 2026-10-19, so a pull-request preview lives on a single host, like the sibling apps): the app at `https://festipod.dev.reconnexion.coop/`, the backend on the same host under `/api` — its Domains field is `https://<host>/api,https://<host>/.well-known`. Coolify's **Strip Prefixes must be OFF** (it is on the sibling apps): the backend mounts its routes under `/api` itself, read from `SEMAPPS_HOME_URL=https://<host>/api/`, and the front end is pointed at `VITE_BACKEND_URL=https://<host>/api`. With the prefix stripped every backend request is refused (404).
+10 -5
View File
@@ -56,11 +56,16 @@ services:
SEMAPPS_JENA_USER: ${JENA_USER:-admin}
SEMAPPS_JENA_PASSWORD: ${JENA_PASSWORD}
# A pair of datasets named after DATASET_PREFIX and the backend's service name, e.g.
# festipod-backend / settings-festipod-backend (…-backend-pr-<n> in a preview). Two
# non-preview stacks on the same Fuseki would share them: give the second its own
# DATASET_PREFIX (or MAIN_DATASET / SETTINGS_DATASET).
SEMAPPS_MAIN_DATASET: ${MAIN_DATASET:-${DATASET_PREFIX:-festipod}-${SERVICE_NAME_BACKEND}}
SEMAPPS_AUTH_ACCOUNTS_DATASET_NAME: ${SETTINGS_DATASET:-settings-${DATASET_PREFIX:-festipod}-${SERVICE_NAME_BACKEND}}
# festipod-backend / settings-festipod-backend (…-backend-pr-<n> in a preview); both
# are used (the second holds the accounts and the webhook listeners). Two non-preview
# stacks on the same Fuseki would share them: give the second its own DATASET_PREFIX,
# in both its normal and preview scopes.
# Computed here, not through an overridable MAIN_DATASET / SETTINGS_DATASET (the sibling
# apps' pattern, which they need to keep historical datasets): Coolify stores such a
# default, itself an expression, as the variable's value — it reads as unresolved text
# in its UI although docker compose resolves it from the .env at deploy time.
SEMAPPS_MAIN_DATASET: ${DATASET_PREFIX:-festipod}-${SERVICE_NAME_BACKEND}
SEMAPPS_AUTH_ACCOUNTS_DATASET_NAME: settings-${DATASET_PREFIX:-festipod}-${SERVICE_NAME_BACKEND}
SEMAPPS_REDIS_CACHE_URL: redis://${SERVICE_NAME_FESTIPOD_REDIS}:6379/0
SEMAPPS_QUEUE_SERVICE_URL: redis://${SERVICE_NAME_FESTIPOD_REDIS}:6379/1