diff --git a/docker/demo/.env.example b/docker/demo/.env.example new file mode 100644 index 00000000..09ac7bc6 --- /dev/null +++ b/docker/demo/.env.example @@ -0,0 +1,9 @@ +# Database password for PostgreSQL. Use a random 32+ character string. +POSTGRES_PASSWORD=change-me-to-a-random-32-char-string + +# Secret used to sign NextAuth sessions and to derive the initial encryption key. +# Use a random 32+ character string. Generate with: openssl rand -base64 32 +NEXTAUTH_SECRET=change-me-to-a-random-32-char-string + +# VF_VERSION pins the server image tag (default: latest). +#VF_VERSION=1.2.3 diff --git a/docker/demo/docker-compose.yml b/docker/demo/docker-compose.yml new file mode 100644 index 00000000..190f36bb --- /dev/null +++ b/docker/demo/docker-compose.yml @@ -0,0 +1,54 @@ +services: + postgres: + container_name: vectorflow-demo-postgres + image: timescale/timescaledb:latest-pg16 + environment: + POSTGRES_DB: vectorflow + POSTGRES_USER: vectorflow + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + volumes: + - pgdata:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U vectorflow"] + interval: 5s + timeout: 5s + retries: 5 + restart: unless-stopped + + vectorflow: + container_name: vectorflow-demo-server + image: ghcr.io/terrifiedbug/vectorflow-server:${VF_VERSION:-latest} + depends_on: + postgres: + condition: service_healthy + ports: + - "3000:3000" + environment: + DATABASE_URL: postgresql://vectorflow:${POSTGRES_PASSWORD}@postgres:5432/vectorflow + NEXTAUTH_SECRET: ${NEXTAUTH_SECRET} + NEXTAUTH_URL: https://demo.vectorflow.sh + AUTH_TRUST_HOST: "true" + VF_DEMO_MODE: "true" + volumes: + - vfdata:/app/.vectorflow + - backups:/backups + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health/ready"] + interval: 30s + timeout: 5s + start_period: 30s + retries: 3 + deploy: + resources: + limits: + memory: 1g + cpus: "2.0" + restart: unless-stopped + +volumes: + pgdata: + name: vectorflow-demo-pgdata + vfdata: + name: vectorflow-demo-data + backups: + name: vectorflow-demo-backups diff --git a/docker/server/.env.example b/docker/server/.env.example index 9e98ef1a..9a27b553 100644 --- a/docker/server/.env.example +++ b/docker/server/.env.example @@ -20,9 +20,14 @@ NEXTAUTH_SECRET=change-me-to-a-random-32-char-string # ── Optional ────────────────────────────────────────────────── -# Set to your canonical URL in production (e.g., https://vectorflow.example.com) -# When unset, AUTH_TRUST_HOST=true infers the URL from the Host header. -#NEXTAUTH_URL=http://localhost:3000 +# Canonical public URL of this deployment (e.g., https://vectorflow.example.com). +# Required for OAuth/OIDC callback URLs and "reset password" email links to resolve +# correctly. AUTH_TRUST_HOST=true (set in docker-compose.yml) allows the server to +# infer the URL from the X-Forwarded-Host header when this is unset, but setting it +# explicitly is strongly recommended for any public deployment. +# The hosted demo uses docker/demo/docker-compose.yml which hardcodes +# NEXTAUTH_URL=https://demo.vectorflow.sh. For all other deployments set this: +#NEXTAUTH_URL=https://vectorflow.example.com # Server port (default: 3000) #PORT=3000 diff --git a/docker/server/docker-compose.yml b/docker/server/docker-compose.yml index e8dbe5af..fb1a1404 100644 --- a/docker/server/docker-compose.yml +++ b/docker/server/docker-compose.yml @@ -29,6 +29,7 @@ services: DATABASE_URL: postgresql://vectorflow:${POSTGRES_PASSWORD}@postgres:5432/vectorflow NEXTAUTH_SECRET: ${NEXTAUTH_SECRET} NEXTAUTH_URL: ${NEXTAUTH_URL} + AUTH_TRUST_HOST: "true" volumes: - vfdata:/app/.vectorflow - backups:/backups