sightbox/docker-compose.yml

104 lines
4.8 KiB
YAML

# Root launch path for the sightbox deployment (Dokploy points here).
# Brings up frappe_docker's unmodified stack via `include:` (base compose.yaml
# + the mariadb/redis/noproxy overrides, merged exactly as multiple -f flags
# would merge them) and adds this client's one custom service, backend-billing,
# on the same default project network. frappe_docker/ itself is never edited
# or duplicated here — see frappe_docker/docs/02-setup/05-overrides.md for
# what each included override file does.
#
# noproxy is used (not compose.https.yaml/compose.traefik.yaml) because
# Dokploy provides its own reverse proxy/TLS layer in front of whatever port
# a compose service exposes; running frappe_docker's own Traefik here would
# double up proxies. Reassess if the deployment target changes.
include:
- path:
- frappe_docker/compose.yaml
- frappe_docker/overrides/compose.mariadb.yaml
- frappe_docker/overrides/compose.redis.yaml
- frappe_docker/overrides/compose.noproxy.yaml
services:
# frappe_docker/compose.yaml hardcodes platform: linux/amd64 on every
# Frappe-image service. That's correct for the real deployment target
# (an x86_64 Dokploy VPS) but forces QEMU emulation on an Apple Silicon
# dev machine, where pyarrow's native code segfaults under emulation.
# FRAPPE_IMAGE_PLATFORM lets a local arm64 dev machine override this to
# linux/arm64 (frappe/erpnext ships a native arm64 image) via its own
# .env, without changing the default for production.
configurator:
platform: ${FRAPPE_IMAGE_PLATFORM:-linux/amd64}
backend:
platform: ${FRAPPE_IMAGE_PLATFORM:-linux/amd64}
frontend:
platform: ${FRAPPE_IMAGE_PLATFORM:-linux/amd64}
websocket:
platform: ${FRAPPE_IMAGE_PLATFORM:-linux/amd64}
queue-short:
platform: ${FRAPPE_IMAGE_PLATFORM:-linux/amd64}
queue-long:
platform: ${FRAPPE_IMAGE_PLATFORM:-linux/amd64}
scheduler:
platform: ${FRAPPE_IMAGE_PLATFORM:-linux/amd64}
marketing:
# The public BettersightBox marketing/sales page — deliberately NOT a
# Frappe Web Page. Confirmed the hard way: stock Frappe/ERPNext has no
# mechanism to serve a fully custom, unwrapped HTML document at a route
# without a custom app — every Web Page unconditionally extends
# templates/web.html, so Frappe's own topbar/footer would wrap around
# this page's own from-scratch nav/hero and double up. A plain nginx
# service serving the file directly keeps it fully decoupled from
# Frappe's templating and safe across Frappe/ERPNext upgrades.
#
# This container fronts the product's own marketing domain, separate
# from any client's ERPNext site (which lives on its own domain/
# subdomain via the `frontend` service, e.g. <client>.yourdomain.com).
# The page's own "Sign in" link is a hardcoded absolute URL to this
# bench's login page for local dev — repoint it at each real client's
# actual domain before that client's launch, same spirit as rebuilding
# the demo guides with a real client's names (see CLAUDE.md).
image: nginx:alpine
restart: unless-stopped
volumes:
- ./bettersightbox-index.html:/usr/share/nginx/html/index.html:ro
ports:
- ${MARKETING_PUBLISH_PORT:-8091}:80
backend-billing:
build:
context: ./backend
restart: unless-stopped
env_file:
- ./backend/.env
volumes:
- billing-state:/data
# Per-tenant credentials, mounted read-only at runtime — never baked
# into the image (see backend/.dockerignore). Multi-tenant billing:
# every client's Frappe API key/secret and Stripe webhook secret live
# here, one JSON object per tenant slug (see backend/tenants.example.json).
- ./backend/tenants.json:/app/tenants.json:ro
depends_on:
- backend
ports:
- ${BILLING_PUBLISH_PORT:-8001}:8000
volumes:
# Plain Docker-managed volumes by default — safe on any host OS. For the
# real Linux deployment target, layer docker-compose.data-dir.yml on top
# (-f docker-compose.yml -f docker-compose.data-dir.yml) to redirect these
# to one visible, backup-able host directory instead. Never do that layering
# for local dev on macOS/Windows: Docker Desktop's bind mount runs the
# container's view of that directory through the *host's* filesystem
# semantics, and macOS's default filesystem is case-insensitive — confirmed
# the hard way: MariaDB silently sets lower_case_table_names=2 against a
# case-insensitive filesystem, which does not match how this data's tables
# were actually created, and every query starts failing with "doesn't exist
# in engine". Docker's own named-volume storage (used here) lives inside
# the Desktop VM's Linux filesystem regardless of host OS, so it never hits
# this — only a host bind mount can. See playbook/BACKUP_RESTORE.md.
billing-state:
sites:
db-data:
redis-queue-data: