mirror of
https://github.com/colanode/colanode.git
synced 2026-02-24 11:59:53 +01:00
* feat: implement JSON-based configuration system with env var overrides - Add config.json support (replaces .env file dependency) - Implement deepMerge and normalizeValue functions in loader.ts - Support env:// syntax in JSON for runtime environment variable injection - Add optional env var support with ? suffix (e.g., env://VAR_NAME?) - Extract schema.ts to separate concerns (validation vs loading) - Rename read*ConfigVariables to read*ConfigFromEnv for clarity - Improve boolean env var parsing (handle false explicitly, not just truthy) - Document configuration precedence: env > config.json > defaults - Add config.json and config.local.json to .gitignore - Update .env.example with migration guide for new system - Maintain backward compatibility: env vars still work without JSON files * - add docker compose and kuberenetes support for the new configuration flow. - document config.json workflow for self-hosting * update config json implementation
136 lines
4.3 KiB
YAML
136 lines
4.3 KiB
YAML
version: '3.8'
|
||
|
||
services:
|
||
postgres:
|
||
image: pgvector/pgvector:pg17
|
||
container_name: colanode_postgres
|
||
restart: always
|
||
environment:
|
||
POSTGRES_USER: colanode_user
|
||
POSTGRES_PASSWORD: postgrespass123
|
||
POSTGRES_DB: colanode_db
|
||
volumes:
|
||
- postgres_data:/var/lib/postgresql/data
|
||
ports:
|
||
- '5432:5432'
|
||
networks:
|
||
- colanode_network
|
||
|
||
valkey:
|
||
image: valkey/valkey:8.1
|
||
container_name: colanode_valkey
|
||
restart: always
|
||
command: ['valkey-server', '--requirepass', 'your_valkey_password']
|
||
volumes:
|
||
- valkey_data:/data
|
||
ports:
|
||
- '6379:6379'
|
||
networks:
|
||
- colanode_network
|
||
|
||
# ---------------------------------------------------------------
|
||
# Optional MinIO Object Storage (Enable when using S3 storage)
|
||
# ---------------------------------------------------------------
|
||
minio:
|
||
profiles:
|
||
- s3
|
||
image: minio/minio:RELEASE.2025-04-08T15-41-24Z
|
||
container_name: colanode_minio
|
||
restart: always
|
||
environment:
|
||
MINIO_ROOT_USER: minioadmin
|
||
MINIO_ROOT_PASSWORD: your_minio_password
|
||
MINIO_BROWSER: 'on'
|
||
MINIO_DOMAIN: minio
|
||
MINIO_ADDRESS: ':9000'
|
||
MINIO_CONSOLE_ADDRESS: ':9001'
|
||
volumes:
|
||
- minio_data:/data
|
||
ports:
|
||
- '9000:9000'
|
||
- '9001:9001'
|
||
entrypoint: sh
|
||
command: -c 'mkdir -p /data/colanode && minio server /data --address ":9000" --console-address ":9001"'
|
||
networks:
|
||
- colanode_network
|
||
|
||
# ---------------------------------------------------------------
|
||
# Optional SMTP Server (Mailpit) for Local Email Testing
|
||
# ---------------------------------------------------------------
|
||
# This service runs Mailpit, a local SMTP testing tool.
|
||
# If you want to test how emails are sent in the 'server' service,
|
||
# uncomment the 'smtp' service block, set email.enabled=true in config.json,
|
||
# point the email provider to "smtp", and define EMAIL_HOST /
|
||
# EMAIL_SMTP_USER / EMAIL_SMTP_PASSWORD env vars (and any others) so the
|
||
# SMTP provider block in config.json resolves via env:// pointers.
|
||
#
|
||
# Access the Mailpit UI at http://localhost:8025
|
||
# ---------------------------------------------------------------
|
||
# smtp:
|
||
# image: axllent/mailpit:v1.24.1
|
||
# container_name: colanode_smtp
|
||
# restart: always
|
||
# ports:
|
||
# - '1025:1025' # SMTP IN (Connect server service to this port)
|
||
# - '8025:8025' # Web UI
|
||
# networks:
|
||
# - colanode_network
|
||
|
||
server:
|
||
image: ghcr.io/colanode/server:latest
|
||
container_name: colanode_server
|
||
restart: always
|
||
depends_on:
|
||
- postgres
|
||
- valkey
|
||
# - smtp # Optional
|
||
environment:
|
||
# ------------------------------------------------------------------
|
||
# Configuration Strategy
|
||
# ------------------------------------------------------------------
|
||
# - All defaults live in config.json mounted at /app/apps/server/config.json
|
||
# - config.json references secrets via env://VAR or read values from files via file://path
|
||
# - The variables below are only those secrets; every other setting
|
||
# must be changed inside the JSON file
|
||
# ------------------------------------------------------------------
|
||
NODE_ENV: production
|
||
|
||
# Required env:// secrets (config.json marks these as env://VAR)
|
||
POSTGRES_URL: postgres://colanode_user:postgrespass123@postgres:5432/colanode_db
|
||
REDIS_URL: redis://:your_valkey_password@valkey:6379/0
|
||
|
||
# Optional env://? secrets – include only the entries referenced in JSON
|
||
# Use file://path entries in config.json when you want to read the value from mounted files instead.
|
||
# ACCOUNT_GOOGLE_CLIENT_ID: ''
|
||
# ACCOUNT_GOOGLE_CLIENT_SECRET: ''
|
||
# ...
|
||
|
||
ports:
|
||
- '3000:3000'
|
||
volumes:
|
||
- server_storage:/var/lib/colanode/storage
|
||
# Mount a config.json sitting next to this compose file to override defaults.
|
||
# If omitted, the already included config.json inside the server image is used.
|
||
- ./config.json:/app/apps/server/config.json:ro
|
||
networks:
|
||
- colanode_network
|
||
|
||
web:
|
||
image: ghcr.io/colanode/web:latest
|
||
container_name: colanode_web
|
||
restart: always
|
||
ports:
|
||
- '4000:80'
|
||
networks:
|
||
- colanode_network
|
||
|
||
volumes:
|
||
postgres_data:
|
||
valkey_data:
|
||
minio_data:
|
||
server_storage:
|
||
|
||
networks:
|
||
colanode_network:
|
||
driver: bridge
|