5b61ce9905
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.
102 lines
4.9 KiB
YAML
102 lines
4.9 KiB
YAML
# Docker Compose definition used by Coolify to build and run Festipod straight from the
|
|
# git repository: one stack for the branch it follows (the test environment). The images
|
|
# are built on the Coolify server from the two Dockerfiles of this repository (the app at
|
|
# the root, the backend in /backend); nothing is pulled from a registry.
|
|
#
|
|
# Before `docker compose build` and `up`, Coolify writes a .env file next to this file
|
|
# with the variables defined in its UI plus generated ones. The generated ones used here:
|
|
# SERVICE_FQDN_BACKEND / SERVICE_FQDN_FRONTEND host of each service, as set in its
|
|
# Domains field
|
|
# SERVICE_NAME_BACKEND / SERVICE_NAME_FESTIPOD_REDIS service names (Coolify suffixes
|
|
# them with "-pr-<n>" in a preview)
|
|
# A value starting with `${` becomes an editable variable in Coolify (with its default);
|
|
# the other `${...}` references are only interpolated by docker compose.
|
|
#
|
|
# One base URL per environment, as for the other ActivityPods apps on this Coolify (it is
|
|
# what lets a pull request preview live on a single host): the frontend's domain serves the
|
|
# app, and the backend is served on the same host under `/api` and `/.well-known` — its
|
|
# Domains field is `https://<host>/api,https://<host>/.well-known`. The proxy must pass those
|
|
# paths through unchanged — Coolify's "Strip Prefixes" OFF, as on the other apps: the backend
|
|
# mounts its routes under `/api` itself, from its base URL, and keeps its `/.well-known` ones
|
|
# at the origin root (backend/services/base-path.js). With the prefixes stripped, every
|
|
# backend request would be refused (404).
|
|
#
|
|
# The backend registers its app actor in its main dataset on the first boot, with the
|
|
# domain it had at that time: set the domains in Coolify BEFORE the first deployment. If
|
|
# they change later, delete the two datasets in Fuseki and redeploy.
|
|
#
|
|
# Fuseki is the one shared with the other apps (shared-infra, in the "infra" project): the
|
|
# backend joins the "coolify" network to reach it, with its own pair of datasets. Redis
|
|
# runs inside the stack (on the stack's private network only, under a name that cannot be
|
|
# confused with the shared one).
|
|
|
|
services:
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
restart: always
|
|
depends_on:
|
|
- festipod-redis
|
|
expose:
|
|
- '3003'
|
|
# Coolify adds the stack's own network to every service; only the backend also needs
|
|
# the shared one, where Fuseki lives.
|
|
networks:
|
|
- coolify
|
|
environment:
|
|
SEMAPPS_APP_NAME: ${APP_NAME:-Festipod}
|
|
SEMAPPS_APP_DESCRIPTION: ${APP_DESCRIPTION:-Points de rencontre sur les événements publics}
|
|
SEMAPPS_APP_LANG: ${APP_LANG:-en,fr}
|
|
SEMAPPS_HOME_URL: https://${SERVICE_FQDN_BACKEND}/api/
|
|
SEMAPPS_FRONT_URL: https://${SERVICE_FQDN_FRONTEND}
|
|
SEMAPPS_PORT: '3003'
|
|
SEMAPPS_SHAPE_REPOSITORY_URL: ${SHAPE_REPOSITORY_URL:-https://shapes.activitypods.org/}
|
|
SEMAPPS_SPARQL_ENDPOINT: ${SPARQL_ENDPOINT}
|
|
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); 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
|
|
|
|
frontend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: always
|
|
depends_on:
|
|
- backend
|
|
expose:
|
|
- '3000'
|
|
# Read by the server on every request to /festipod-config.json, not inlined at build
|
|
# time: changing one needs a restart, not a rebuild.
|
|
environment:
|
|
PORT: '3000'
|
|
VITE_BACKEND_URL: https://${SERVICE_FQDN_BACKEND}/api
|
|
# The Pod provider the login screen offers in one click; any other can be typed in.
|
|
VITE_POD_PROVIDER_URL: ${POD_PROVIDER_URL:-https://mypod.store}
|
|
|
|
festipod-redis:
|
|
image: redis:7-alpine
|
|
restart: always
|
|
command: ['redis-server', '--appendonly', 'yes']
|
|
volumes:
|
|
- redis-data:/data
|
|
|
|
volumes:
|
|
redis-data:
|
|
|
|
networks:
|
|
coolify:
|
|
external: true
|