269 lines
10 KiB
YAML
269 lines
10 KiB
YAML
version: '3.8'
|
|
services:
|
|
langfuse-worker:
|
|
hostname: 0.0.0.0
|
|
env_file:
|
|
- stack.env
|
|
image: docker.io/langfuse/langfuse-worker:3
|
|
depends_on: &langfuse-depends-on
|
|
- clickhouse
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "const http=require('http');const req=http.get('http://127.0.0.1:3030/api/health',res=>{process.exit(res.statusCode===200?0:1)});req.on('error',()=>process.exit(1));"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
environment: &langfuse-worker-env
|
|
# NEXTAUTH_URL: ${NEXTAUTH_URL:-http://localhost:3000}
|
|
# DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/postgres} # CHANGEME
|
|
# SALT: ${SALT:-mysalt} # CHANGEME
|
|
# ENCRYPTION_KEY: ${ENCRYPTION_KEY:-0000000000000000000000000000000000000000000000000000000000000000} # CHANGEME: generate via `openssl rand -hex 32`
|
|
TELEMETRY_ENABLED: ${TELEMETRY_ENABLED:-true}
|
|
LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES: ${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-true}
|
|
CLICKHOUSE_MIGRATION_URL: ${CLICKHOUSE_MIGRATION_URL:-clickhouse://clickhouse:9000}
|
|
CLICKHOUSE_URL: ${CLICKHOUSE_URL:-http://clickhouse:8123}
|
|
CLICKHOUSE_USER: ${CLICKHOUSE_USER:-clickhouse}
|
|
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-clickhouse} # CHANGEME
|
|
CLICKHOUSE_CLUSTER_ENABLED: ${CLICKHOUSE_CLUSTER_ENABLED:-false}
|
|
LANGFUSE_USE_AZURE_BLOB: ${LANGFUSE_USE_AZURE_BLOB:-false}
|
|
# LANGFUSE_S3_EVENT_UPLOAD_BUCKET: ${LANGFUSE_S3_EVENT_UPLOAD_BUCKET:-langfuse}
|
|
# LANGFUSE_S3_EVENT_UPLOAD_REGION: ${LANGFUSE_S3_EVENT_UPLOAD_REGION:-auto}
|
|
# LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID: ${LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID:-minio}
|
|
# LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY: ${LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY:-miniosecret} # CHANGEME
|
|
# LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT: ${LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT:-http://minio:9000}
|
|
# LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE: ${LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE:-true}
|
|
# LANGFUSE_S3_EVENT_UPLOAD_PREFIX: ${LANGFUSE_S3_EVENT_UPLOAD_PREFIX:-events/}
|
|
# LANGFUSE_S3_MEDIA_UPLOAD_BUCKET: ${LANGFUSE_S3_MEDIA_UPLOAD_BUCKET:-langfuse}
|
|
# LANGFUSE_S3_MEDIA_UPLOAD_REGION: ${LANGFUSE_S3_MEDIA_UPLOAD_REGION:-auto}
|
|
# LANGFUSE_S3_MEDIA_UPLOAD_ACCESS_KEY_ID: ${LANGFUSE_S3_MEDIA_UPLOAD_ACCESS_KEY_ID:-minio}
|
|
# LANGFUSE_S3_MEDIA_UPLOAD_SECRET_ACCESS_KEY: ${LANGFUSE_S3_MEDIA_UPLOAD_SECRET_ACCESS_KEY:-miniosecret} # CHANGEME
|
|
# LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT: ${LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT:-http://localhost:9090}
|
|
# LANGFUSE_S3_MEDIA_UPLOAD_FORCE_PATH_STYLE: ${LANGFUSE_S3_MEDIA_UPLOAD_FORCE_PATH_STYLE:-true}
|
|
# LANGFUSE_S3_MEDIA_UPLOAD_PREFIX: ${LANGFUSE_S3_MEDIA_UPLOAD_PREFIX:-media/}
|
|
# LANGFUSE_S3_BATCH_EXPORT_ENABLED: ${LANGFUSE_S3_BATCH_EXPORT_ENABLED:-false}
|
|
# LANGFUSE_S3_BATCH_EXPORT_BUCKET: ${LANGFUSE_S3_BATCH_EXPORT_BUCKET:-langfuse}
|
|
# LANGFUSE_S3_BATCH_EXPORT_PREFIX: ${LANGFUSE_S3_BATCH_EXPORT_PREFIX:-exports/}
|
|
# LANGFUSE_S3_BATCH_EXPORT_REGION: ${LANGFUSE_S3_BATCH_EXPORT_REGION:-auto}
|
|
# LANGFUSE_S3_BATCH_EXPORT_ENDPOINT: ${LANGFUSE_S3_BATCH_EXPORT_ENDPOINT:-http://minio:9000}
|
|
# LANGFUSE_S3_BATCH_EXPORT_EXTERNAL_ENDPOINT: ${LANGFUSE_S3_BATCH_EXPORT_EXTERNAL_ENDPOINT:-http://localhost:9090}
|
|
# LANGFUSE_S3_BATCH_EXPORT_ACCESS_KEY_ID: ${LANGFUSE_S3_BATCH_EXPORT_ACCESS_KEY_ID:-minio}
|
|
# LANGFUSE_S3_BATCH_EXPORT_SECRET_ACCESS_KEY: ${LANGFUSE_S3_BATCH_EXPORT_SECRET_ACCESS_KEY:-miniosecret} # CHANGEME
|
|
LANGFUSE_S3_BATCH_EXPORT_FORCE_PATH_STYLE: ${LANGFUSE_S3_BATCH_EXPORT_FORCE_PATH_STYLE:-true}
|
|
LANGFUSE_INGESTION_QUEUE_DELAY_MS: ${LANGFUSE_INGESTION_QUEUE_DELAY_MS:-}
|
|
LANGFUSE_INGESTION_CLICKHOUSE_WRITE_INTERVAL_MS: ${LANGFUSE_INGESTION_CLICKHOUSE_WRITE_INTERVAL_MS:-}
|
|
# REDIS_HOST: ${REDIS_HOST:-redis}
|
|
# REDIS_PORT: ${REDIS_PORT:-6379}
|
|
# REDIS_AUTH: ${REDIS_AUTH:-myredissecret} # CHANGEME
|
|
# REDIS_TLS_ENABLED: ${REDIS_TLS_ENABLED:-false}
|
|
# REDIS_TLS_CA: ${REDIS_TLS_CA:-/certs/ca.crt}
|
|
# REDIS_TLS_CERT: ${REDIS_TLS_CERT:-/certs/redis.crt}
|
|
# REDIS_TLS_KEY: ${REDIS_TLS_KEY:-/certs/redis.key}
|
|
# EMAIL_FROM_ADDRESS: ${EMAIL_FROM_ADDRESS:-}
|
|
# SMTP_CONNECTION_URL: ${SMTP_CONNECTION_URL:-}
|
|
expose:
|
|
- '3030'
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
delay: 5s
|
|
max_attempts: 3
|
|
placement:
|
|
constraints:
|
|
- node.hostname == crackbox
|
|
networks:
|
|
- net
|
|
- minio_net
|
|
langfuse-web:
|
|
hostname: 0.0.0.0
|
|
image: docker.io/langfuse/langfuse:3
|
|
depends_on: *langfuse-depends-on
|
|
env_file:
|
|
- stack.env
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "const http=require('http');const req=http.get('http://127.0.0.1:3000/api/public/health',res=>{process.exit(res.statusCode===200?0:1)});req.on('error',()=>process.exit(1));"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
environment:
|
|
<<: *langfuse-worker-env
|
|
# NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-mysecret} # CHANGEME
|
|
LANGFUSE_INIT_ORG_ID: ${LANGFUSE_INIT_ORG_ID:-}
|
|
LANGFUSE_INIT_ORG_NAME: ${LANGFUSE_INIT_ORG_NAME:-}
|
|
LANGFUSE_INIT_PROJECT_ID: ${LANGFUSE_INIT_PROJECT_ID:-}
|
|
LANGFUSE_INIT_PROJECT_NAME: ${LANGFUSE_INIT_PROJECT_NAME:-}
|
|
LANGFUSE_INIT_PROJECT_PUBLIC_KEY: ${LANGFUSE_INIT_PROJECT_PUBLIC_KEY:-}
|
|
LANGFUSE_INIT_PROJECT_SECRET_KEY: ${LANGFUSE_INIT_PROJECT_SECRET_KEY:-}
|
|
LANGFUSE_INIT_USER_EMAIL: ${LANGFUSE_INIT_USER_EMAIL:-}
|
|
LANGFUSE_INIT_USER_NAME: ${LANGFUSE_INIT_USER_NAME:-}
|
|
LANGFUSE_INIT_USER_PASSWORD: ${LANGFUSE_INIT_USER_PASSWORD:-}
|
|
expose:
|
|
- '3000'
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
delay: 5s
|
|
max_attempts: 3
|
|
placement:
|
|
constraints:
|
|
- node.hostname == crackbox
|
|
labels:
|
|
- traefik.enable=true
|
|
- traefik.swarm.network=public
|
|
- traefik.http.routers.langfuse.service=langfuse
|
|
- traefik.http.routers.langfuse.rule=Host(`fuse.lab`)
|
|
- traefik.http.routers.langfuse.entrypoints=web
|
|
- traefik.http.services.langfuse.loadbalancer.server.port=3000
|
|
networks:
|
|
- net
|
|
- public
|
|
- minio_net
|
|
|
|
clickhouse:
|
|
image: docker.io/clickhouse/clickhouse-server
|
|
user: "101:101"
|
|
env_file:
|
|
- stack.env
|
|
environment:
|
|
CLICKHOUSE_DB: default
|
|
CLICKHOUSE_USER: ${CLICKHOUSE_USER:-clickhouse}
|
|
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-clickhouse} # CHANGEME
|
|
volumes:
|
|
- langfuse_clickhouse_data:/var/lib/clickhouse
|
|
- langfuse_clickhouse_logs:/var/log/clickhouse-server
|
|
healthcheck:
|
|
test: wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 1s
|
|
expose:
|
|
- '8123'
|
|
- '9000'
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
delay: 5s
|
|
max_attempts: 3
|
|
placement:
|
|
constraints:
|
|
- node.hostname == crackbox
|
|
networks:
|
|
- net
|
|
- minio_net
|
|
# minio:
|
|
# image: cgr.dev/chainguard/minio
|
|
# entrypoint: sh
|
|
# # create the 'langfuse' bucket before starting the service
|
|
# command: -c 'mkdir -p /data/langfuse && minio server --address ":9000" --console-address ":9001" /data'
|
|
# environment:
|
|
# MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minio}
|
|
# MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-miniosecret} # CHANGEME
|
|
# volumes:
|
|
# - langfuse_minio_data:/data
|
|
# healthcheck:
|
|
# test: ["CMD", "mc", "ready", "local"]
|
|
# interval: 1s
|
|
# timeout: 5s
|
|
# retries: 5
|
|
# start_period: 1s
|
|
# expose:
|
|
# - '9000'
|
|
# - '9001'
|
|
# deploy:
|
|
# replicas: 1
|
|
# restart_policy:
|
|
# condition: any
|
|
# delay: 5s
|
|
# max_attempts: 3
|
|
# placement:
|
|
# constraints:
|
|
# - node.hostname == crackbox
|
|
# labels:
|
|
# - traefik.enable=true
|
|
# - traefik.http.routers.docker-compose-minio.rule=Host(`minio.example.com`)
|
|
# - traefik.http.routers.docker-compose-minio.entrypoints=web
|
|
# - traefik.http.services.docker-compose-minio.loadbalancer.server.port=9000
|
|
# networks:
|
|
# - net
|
|
# - public
|
|
|
|
# redis:
|
|
# image: docker.io/redis:7
|
|
# command: >
|
|
# --requirepass ${REDIS_AUTH:-myredissecret}
|
|
# --maxmemory-policy noeviction
|
|
# healthcheck:
|
|
# test: ["CMD", "redis-cli", "ping"]
|
|
# interval: 3s
|
|
# timeout: 10s
|
|
# retries: 10
|
|
# expose:
|
|
# - '6379'
|
|
# deploy:
|
|
# replicas: 1
|
|
# restart_policy:
|
|
# condition: any
|
|
# delay: 5s
|
|
# max_attempts: 3
|
|
# placement:
|
|
# constraints:
|
|
# - node.hostname == crackbox
|
|
# networks:
|
|
# - net
|
|
|
|
# postgres:
|
|
# image: docker.io/postgres:${POSTGRES_VERSION:-17}
|
|
# healthcheck:
|
|
# test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
# interval: 3s
|
|
# timeout: 3s
|
|
# retries: 10
|
|
# environment:
|
|
# POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} # CHANGEME
|
|
# POSTGRES_DB: ${POSTGRES_DB:-postgres}
|
|
# TZ: UTC
|
|
# PGTZ: UTC
|
|
# volumes:
|
|
# - langfuse_postgres_data:/var/lib/postgresql/data
|
|
# expose:
|
|
# - '5432'
|
|
# deploy:
|
|
# replicas: 1
|
|
# restart_policy:
|
|
# condition: any
|
|
# delay: 5s
|
|
# max_attempts: 3
|
|
# placement:
|
|
# constraints:
|
|
# - node.hostname == crackbox
|
|
# networks:
|
|
# - net
|
|
volumes:
|
|
# langfuse_postgres_data:
|
|
# driver: local
|
|
# name: langfuse_postgres_data
|
|
langfuse_clickhouse_data:
|
|
driver: local
|
|
name: langfuse_clickhouse_data
|
|
langfuse_clickhouse_logs:
|
|
driver: local
|
|
name: langfuse_clickhouse_logs
|
|
# langfuse_minio_data:
|
|
# driver: local
|
|
# name: langfuse_minio_data
|
|
networks:
|
|
net:
|
|
driver: overlay
|
|
attachable: true
|
|
public:
|
|
external: true
|
|
minio_net:
|
|
external: true
|
|
badge-net:
|
|
external: true
|