Young's Mind
Implementation

Docker tenancy implementation plan

Docker tenancy implementation plan

Prerequisite: prod is now a clean base

  • Vault sync retired (Tam, 2026-10-18) — no vault on prod
  • docs.youngle.au still serves Docus (needs redesign decision)
  • pulse-site.service runs on :8092
  • Docker 29.7.2, Compose v5.4.0, 0 containers, 3 networks (bridge/host/none)
  • Disk: 14G used, 179G free. RAM: 23Gi total, ~21Gi available
  • nginx on 80/443, TLS via letsencrypt

Phase 0: Nginx vhost for tenants (Sol)

Create a reusable nginx vhost template for tenant sites.

  • File: /etc/nginx/sites-available/tenant-<slug>.conf
  • Proxy to container names on tenant networks (no host ports)
  • TLS via certbot (auto-provision)
  • Auth: public storefront + password-gated admin

Phase 1: Tenant network + base compose template

  • Docker network per tenant: tenant-<slug> (bridge, isolated)
  • Compose template with: postgres, redis, medusa-server, medusa-worker, storefront, eve-agent
  • Resource limits per container (from docker-systems-design §2)
  • No host port publication — nginx proxies by container name

Phase 2: Tenant onboarding script

Automated script that does steps 1-10 from docker-systems-design §4:

  1. Validate slug, check collisions
  2. Generate secrets (4 × openssl rand -hex 32)
  3. Render compose from template
  4. Create network
  5. docker compose up -d
  6. Run predeploy (db:migrate)
  7. Create admin user
  8. nginx vhost + certbot
  9. Health gate: /health + /eve/v1/health + admin loads
  10. Mark tenant live

Phase 3: Pilot tenants

  1. Young Le (youngle.au): Website + EVE
    • Simplest tenant: static/Nuxt site + EVE agent
    • No Medusa needed initially
  2. YukonIT (yukonit.com.au): Medusa + storefront + EVE + KB
    • Full 3-in-1 package
    • KB for customer self-help

Phase 4: Pulse website → tenant vhost

  • Move pulse-site.service into a Docker container on a tenant network
  • nginx vhost: pulse.youngle.au → pulse container
  • Remove pulse-site.service from host

Phase 5: Docs website redesign

  • Replace docs.youngle.au content (no vault)
  • New content: product docs, tenant KB, API reference
  • Password-gated (nginx auth_basic, existing young user)
  • Source: curated from LAB, not vault mirror

What's NOT in scope (yet)

  • POS payments (Phase 2 of feature spec)
  • POS offline mode
  • Tenant billing/metering
  • Multi-node scaling (5th tenant = new node)

Security layer (2FA + account management)

See separate note: 2fa-and-account-management.md (to be created)

Blocked on

  • Young's approval to proceed with Phase 0-1 (infrastructure changes on prod)
  • Tam's pulse website containerization (Phase 4)
Copyright © 2026