deploy: support localhost-only demo bind

This commit is contained in:
Marco Allegretti 2026-02-03 11:52:32 +01:00
parent 1b75c1aebe
commit 3d46399cfc
3 changed files with 86 additions and 92 deletions

View file

@ -1,23 +1,25 @@
# Demo Environment Configuration
# Copy to .env.demo and optionally customize
# Database (separate from production)
POSTGRES_USER=likwid_demo
POSTGRES_PASSWORD=demo_secret_change_me
POSTGRES_DB=likwid_demo
DB_PORT=5433
# Backend
JWT_SECRET=demo_jwt_secret_not_for_production
BACKEND_PORT=3001
# Frontend
FRONTEND_PORT=4322
API_BASE=http://localhost:3001
INTERNAL_API_BASE=http://backend:3000
# Demo mode is always enabled for this deployment
# This enables:
# - Demo accounts (contributor, moderator, observer) with password: demo123
# - Pre-seeded communities, proposals, and governance data
# - Restricted destructive actions (cannot delete core demo data)
# Demo Environment Configuration
# Copy to .env.demo and optionally customize
# Database (separate from production)
POSTGRES_USER=likwid_demo
POSTGRES_PASSWORD=demo_secret_change_me
POSTGRES_DB=likwid_demo
DB_PORT=5433
# Backend
JWT_SECRET=demo_jwt_secret_not_for_production
BACKEND_PORT=3001
BACKEND_BIND_HOST=0.0.0.0
# Frontend
FRONTEND_PORT=4322
FRONTEND_BIND_HOST=0.0.0.0
API_BASE=http://localhost:3001
INTERNAL_API_BASE=http://backend:3000
# Demo mode is always enabled for this deployment
# This enables:
# - Demo accounts (contributor, moderator, observer) with password: demo123
# - Pre-seeded communities, proposals, and governance data
# - Restricted destructive actions (cannot delete core demo data)

View file

@ -2,11 +2,3 @@ services:
postgres:
ports:
- "127.0.0.1:${DB_PORT:-5433}:5432"
backend:
ports:
- "127.0.0.1:${BACKEND_PORT:-3001}:3000"
frontend:
ports:
- "127.0.0.1:${FRONTEND_PORT:-4322}:4321"

View file

@ -1,61 +1,61 @@
# Demo deployment - includes demo users, seed data, and restricted actions
# Usage: podman-compose --env-file compose/.env.demo -f compose/demo.yml up -d
# Reset: podman-compose --env-file compose/.env.demo -f compose/demo.yml down -v; podman-compose --env-file compose/.env.demo -f compose/demo.yml up -d
services:
postgres:
image: postgres:16
container_name: likwid-demo-db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-likwid_demo}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-demo_secret_change_me}
POSTGRES_DB: ${POSTGRES_DB:-likwid_demo}
volumes:
- likwid_demo_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-likwid_demo}"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ../backend
dockerfile: Dockerfile
args:
INCLUDE_DEMO_SEED: "true"
container_name: likwid-demo-backend
restart: unless-stopped
ports:
- "${BACKEND_PORT:-3001}:3000"
environment:
DATABASE_URL: postgres://${POSTGRES_USER:-likwid_demo}:${POSTGRES_PASSWORD:-demo_secret_change_me}@postgres:5432/${POSTGRES_DB:-likwid_demo}
JWT_SECRET: ${JWT_SECRET:-demo_jwt_secret_not_for_production}
SERVER_HOST: 0.0.0.0
SERVER_PORT: 3000
DEMO_MODE: "true"
RUST_LOG: info
depends_on:
postgres:
condition: service_healthy
frontend:
build:
context: ../frontend
dockerfile: Dockerfile
args:
API_BASE: ${API_BASE:-http://localhost:3001}
container_name: likwid-demo-frontend
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-4322}:4321"
environment:
INTERNAL_API_BASE: http://backend:3000
API_BASE: ${API_BASE:-http://localhost:3001}
PUBLIC_DEMO_SITE: ${PUBLIC_DEMO_SITE:-false}
depends_on:
- backend
volumes:
likwid_demo_data:
# Demo deployment - includes demo users, seed data, and restricted actions
# Usage: podman-compose --env-file compose/.env.demo -f compose/demo.yml up -d
# Reset: podman-compose --env-file compose/.env.demo -f compose/demo.yml down -v; podman-compose --env-file compose/.env.demo -f compose/demo.yml up -d
services:
postgres:
image: postgres:16
container_name: likwid-demo-db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-likwid_demo}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-demo_secret_change_me}
POSTGRES_DB: ${POSTGRES_DB:-likwid_demo}
volumes:
- likwid_demo_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-likwid_demo}"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ../backend
dockerfile: Dockerfile
args:
INCLUDE_DEMO_SEED: "true"
container_name: likwid-demo-backend
restart: unless-stopped
ports:
- "${BACKEND_BIND_HOST:-0.0.0.0}:${BACKEND_PORT:-3001}:3000"
environment:
DATABASE_URL: postgres://${POSTGRES_USER:-likwid_demo}:${POSTGRES_PASSWORD:-demo_secret_change_me}@postgres:5432/${POSTGRES_DB:-likwid_demo}
JWT_SECRET: ${JWT_SECRET:-demo_jwt_secret_not_for_production}
SERVER_HOST: 0.0.0.0
SERVER_PORT: 3000
DEMO_MODE: "true"
RUST_LOG: info
depends_on:
postgres:
condition: service_healthy
frontend:
build:
context: ../frontend
dockerfile: Dockerfile
args:
API_BASE: ${API_BASE:-http://localhost:3001}
container_name: likwid-demo-frontend
restart: unless-stopped
ports:
- "${FRONTEND_BIND_HOST:-0.0.0.0}:${FRONTEND_PORT:-4322}:4321"
environment:
INTERNAL_API_BASE: http://backend:3000
API_BASE: ${API_BASE:-http://localhost:3001}
PUBLIC_DEMO_SITE: ${PUBLIC_DEMO_SITE:-false}
depends_on:
- backend
volumes:
likwid_demo_data: