feat(deploy): env-overridable volume names + host port for Coolify

BF_DATA_VOLUME_NAME, NODERED_DATA_VOLUME_NAME, BF_HOST_PORT keep the
compose public while letting per-deployment specifics (host paths,
multiple staging/prod instances on one host, alternate edge ports)
land in Coolify's env tab. Defaults preserve current behaviour.
This commit is contained in:
Mitchell R 2026-05-18 11:50:51 +02:00
parent afc560bbf5
commit f3c5504b4f
No known key found for this signature in database

View file

@ -4,12 +4,18 @@
# Usage:
# docker compose -f deploy/docker/docker-compose.yml up -d --build
#
# Volumes:
# betterframe-data: sqlite DB + secret.key
# nodered-data: Node-RED flows
# Volumes (override per-deployment via env — see Coolify "Environment"):
# BF_DATA_VOLUME_NAME default "betterframe-data"
# NODERED_DATA_VOLUME_NAME default "nodered-data"
# BF_HOST_PORT default 80 (host edge port mapped to angie)
#
# Only 0.0.0.0:80 is published on the host. Backend services and Node-RED
# are reachable only from within the Docker network.
# Coolify ops: set these env vars on the resource so each deployment owns its
# own named volumes (e.g. "bf-prod-data" vs "bf-staging-data"). For host bind
# mounts or NFS / S3-CSI volumes, use Coolify's per-service "Storage" UI
# rather than templating driver_opts here — JSON injection via env is brittle.
#
# Only ${BF_HOST_PORT}:80 is published on the host. Backend services and
# Node-RED are reachable only from within the Docker network.
version: "3.8"
services:
@ -57,7 +63,7 @@ services:
- server
- nodered
ports:
- "80:80"
- "${BF_HOST_PORT:-80}:80"
volumes:
- ../angie/betterframe.docker.conf:/etc/nginx/conf.d/default.conf:ro
networks:
@ -86,8 +92,14 @@ services:
- betterframe
volumes:
# Top-level keys are the in-compose references used above. `name:` sets the
# actual docker volume name on the host so multiple Coolify deployments on
# the same host can share machine without name collisions. Default keeps
# backward compat with existing single-host deployments.
betterframe-data:
name: ${BF_DATA_VOLUME_NAME:-betterframe-data}
nodered-data:
name: ${NODERED_DATA_VOLUME_NAME:-nodered-data}
networks:
betterframe: