A bleeding-edge container running next to a stable one on the same dev box is easy to confuse, and a branch-only badge would force perpetual rebase/cherry-pick drift between main and dev-be. Instead the badge is config-driven: the settings endpoint injects a synthetic env_label from SHOPDB_ENV_LABEL, the sidebar renders a red DEV tag only when it is non-empty, and stable simply leaves it unset. Same code on both channels, no divergence. dev-bootstrap.ps1 makes a fresh Windows box turnkey: it checks git/Docker (winget-installs with a prompt), verifies the engine is actually running, then builds and starts an isolated per-channel stack so stable and edge coexist on distinct ports, projects, and volumes. docker-compose.channel.yml is a thin overlay so the base compose file stays channel-agnostic.
28 lines
1.3 KiB
YAML
28 lines
1.3 KiB
YAML
# Channel overlay for side-by-side stable / bleeding-edge stacks.
|
|
#
|
|
# The base docker-compose.yml is channel-agnostic. This overlay adds only the
|
|
# pieces that differ between a stable (main) and an edge (dev-be) stack so the
|
|
# two can run at once on one dev workstation without colliding:
|
|
#
|
|
# - SHOPDB_ENV_LABEL is passed into the api container. When non-empty the
|
|
# public settings endpoint surfaces it as env_label and the sidebar renders
|
|
# a red DEV badge. Stable leaves it unset, so nothing renders.
|
|
# - Ports fall back to the SAME defaults as the base file, so running this
|
|
# overlay alone changes nothing; the bootstrap script overrides API_PORT /
|
|
# MYSQL_PORT for the edge stack so both channels bind distinct host ports.
|
|
#
|
|
# The stacks are isolated by compose project name (-p shopdb-stable /
|
|
# -p shopdb-edge), which namespaces containers, networks, and the named
|
|
# volumes, so each channel keeps its own database and instance state.
|
|
#
|
|
# Usage (driven by scripts/dev-bootstrap.ps1, shown here for reference):
|
|
# docker compose -p shopdb-edge \
|
|
# -f docker-compose.yml -f docker-compose.channel.yml up -d
|
|
|
|
services:
|
|
api:
|
|
environment:
|
|
# Empty on stable. The edge stack sets SHOPDB_ENV_LABEL=DEV in its .env
|
|
# (written by the bootstrap script) to light up the badge.
|
|
SHOPDB_ENV_LABEL: ${SHOPDB_ENV_LABEL:-}
|