From f3c5504b4feb47ca274c8f44e95edac9efa07a07 Mon Sep 17 00:00:00 2001 From: Mitchell R Date: Mon, 18 May 2026 11:50:51 +0200 Subject: [PATCH] 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. --- deploy/docker/docker-compose.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/deploy/docker/docker-compose.yml b/deploy/docker/docker-compose.yml index 106ab4d..4df8a47 100644 --- a/deploy/docker/docker-compose.yml +++ b/deploy/docker/docker-compose.yml @@ -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: