From 8cd042e3b13381306e618ee59316f48eb2244e24 Mon Sep 17 00:00:00 2001 From: Travis Vasceannie Date: Sat, 22 Nov 2025 23:53:09 +0000 Subject: [PATCH] x --- .env | 30 +++++ compose/swarm/docker-compose.affine.yml | 118 ++++++++++++++++++ compose/swarm/docker-compose.cap.yml | 2 + compose/swarm/docker-compose.firecrawl.yml | 2 + compose/swarm/docker-compose.minio.yml | 1 + compose/swarm/docker-compose.n8n.yml | 2 + compose/swarm/docker-compose.unstructured.yml | 2 + docker-compose.yml | 1 + 8 files changed, 158 insertions(+) create mode 100644 .env create mode 100644 compose/swarm/docker-compose.affine.yml diff --git a/.env b/.env new file mode 100644 index 0000000..cfa88cc --- /dev/null +++ b/.env @@ -0,0 +1,30 @@ +# LiteLLM Configuration +DATABASE_URL=postgresql://llmbadmin:squirtle123@litellm-db:5432/litellm +LITELLM_MASTER_KEY=sk-1234 +LITELLM_SALT_KEY=4brKp9QKqdv6fXGeaU9mtWrqs6orQ_h9Et3GFpA9Xew +POSTGRES_USER=llmbadmin +POSTGRES_DB=litellm +POSTGRES_PASSWORD=squirtle123 +UI_USERNAME=vasceannie +UI_PASSWORD=squirtle123 + +# API Keys (add your actual keys here) +OPENAI_API_KEY= +OPENAI_BASE_URL= +COHERE_API_KEY= +OR_SITE_URL= +OR_APP_NAME=Brainbox +OR_API_KEY= +AZURE_API_BASE= +AZURE_API_VERSION= +AZURE_API_KEY= +REPLICATE_API_KEY= +REPLICATE_API_TOKEN= +ANTHROPIC_API_KEY= +INFISICAL_TOKEN= +NOVITA_API_KEY= +INFINITY_API_KEY= +# LANGFUSE_PUBLIC_KEY=pk-lf-ba34bf88-4dfb-4176-bed9-669e9641cf92 +# LANGFUSE_SECRET_KEY=sk-lf-2001d447-a6b4-471f-95c6-d87400b11403 +# LANGFUSE_OTEL_HOST=http://fuse.lab +LITELLM_LOG=WARN diff --git a/compose/swarm/docker-compose.affine.yml b/compose/swarm/docker-compose.affine.yml new file mode 100644 index 0000000..3795e09 --- /dev/null +++ b/compose/swarm/docker-compose.affine.yml @@ -0,0 +1,118 @@ +name: affine +services: + affine: + image: ghcr.io/toeverything/affine:${AFFINE_REVISION:-stable} + container_name: affine_server + expose: + - '${PORT:-3010}' + depends_on: + redis: + condition: service_healthy + postgres: + condition: service_healthy + affine_migration: + condition: service_completed_successfully + volumes: + # custom configurations + - ${UPLOAD_LOCATION}:/root/.affine/storage + - ${CONFIG_LOCATION}:/root/.affine/config + env_file: + - .env + environment: + - REDIS_SERVER_HOST=redis + - DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine} + - AFFINE_INDEXER_ENABLED=true + - AFFINE_INDEXER_SEARCH_ENDPOINT=http://indexer:9308 + restart: unless-stopped + networks: + - affine-net + - crackbox-edge + + affine_migration: + image: ghcr.io/toeverything/affine:${AFFINE_REVISION:-stable} + container_name: affine_migration_job + volumes: + # custom configurations + - ${UPLOAD_LOCATION}:/root/.affine/storage + - ${CONFIG_LOCATION}:/root/.affine/config + command: ['sh', '-c', 'node ./scripts/self-host-predeploy.js'] + env_file: + - .env + environment: + - REDIS_SERVER_HOST=redis + - DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine} + - AFFINE_INDEXER_ENABLED=true + - AFFINE_INDEXER_SEARCH_ENDPOINT=http://indexer:9308 + depends_on: + postgres: + condition: service_healthy + redis: + condition: service_healthy + networks: + - affine-net + + redis: + image: redis + container_name: affine_redis + healthcheck: + test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping'] + interval: 10s + timeout: 5s + retries: 5 + restart: unless-stopped + networks: + - affine-net + + postgres: + image: pgvector/pgvector:pg16 + container_name: affine_postgres + volumes: + - ${DB_DATA_LOCATION}:/var/lib/postgresql/data + environment: + POSTGRES_USER: ${DB_USERNAME} + POSTGRES_PASSWORD: ${DB_PASSWORD} + POSTGRES_DB: ${DB_DATABASE:-affine} + POSTGRES_INITDB_ARGS: '--data-checksums' + # you better set a password for you database + # or you may add 'POSTGRES_HOST_AUTH_METHOD=trust' to ignore postgres security policy + POSTGRES_HOST_AUTH_METHOD: trust + healthcheck: + test: + ['CMD', 'pg_isready', '-U', "${DB_USERNAME}", '-d', "${DB_DATABASE:-affine}"] + interval: 10s + timeout: 5s + retries: 5 + restart: unless-stopped + networks: + - affine-net + + indexer: + image: manticoresearch/manticore:${MANTICORE_VERSION:-10.1.0} + container_name: affine_indexer + env_file: + - .env + networks: + - affine-net + volumes: + - ${MANTICORE_DATA_LOCATION}:/var/lib/manticore + ulimits: + nproc: 65535 + nofile: + soft: 65535 + hard: 65535 + memlock: + soft: -1 + hard: -1 + healthcheck: + test: + ['CMD', 'wget', '-O-', 'http://127.0.0.1:9308'] + interval: 10s + timeout: 5s + retries: 5 + restart: unless-stopped + +networks: + crackbox-edge: + external: true + affine-net: + internal: true diff --git a/compose/swarm/docker-compose.cap.yml b/compose/swarm/docker-compose.cap.yml index f87fdd3..0728400 100755 --- a/compose/swarm/docker-compose.cap.yml +++ b/compose/swarm/docker-compose.cap.yml @@ -33,6 +33,7 @@ services: - node.role == manager labels: - "traefik.enable=true" + - "traefik.swarm.network=public" - "traefik.http.routers.cap-web.rule=Host(`cap.sidepiece.rip`)" - "traefik.http.routers.cap-web.entrypoints=websecure" - "traefik.http.routers.cap-web.tls.certresolver=letsencrypt" @@ -92,6 +93,7 @@ services: - node.role == manager labels: - "traefik.enable=true" + - "traefik.swarm.network=public" - "traefik.http.routers.minio-cap-api.rule=Host(`cap.sidepiece.rip`) && PathPrefix(`/minio`)" - "traefik.http.routers.minio-cap-api.entrypoints=websecure" - "traefik.http.routers.minio-cap-api.tls.certresolver=letsencrypt" diff --git a/compose/swarm/docker-compose.firecrawl.yml b/compose/swarm/docker-compose.firecrawl.yml index 792375b..9420303 100755 --- a/compose/swarm/docker-compose.firecrawl.yml +++ b/compose/swarm/docker-compose.firecrawl.yml @@ -92,6 +92,8 @@ services: memory: 2G labels: - "traefik.enable=true" + - "traefik.swarm.network=public" + - "traefik.swarm.network=public" - "traefik.http.routers.firecrawl-api.rule=Host(`firecrawl.sidepiece.rip`)" - "traefik.http.routers.firecrawl-api.entrypoints=websecure" - "traefik.http.routers.firecrawl-api.tls.certresolver=letsencrypt" diff --git a/compose/swarm/docker-compose.minio.yml b/compose/swarm/docker-compose.minio.yml index 6ed7a8b..86bbf46 100644 --- a/compose/swarm/docker-compose.minio.yml +++ b/compose/swarm/docker-compose.minio.yml @@ -41,6 +41,7 @@ services: max_attempts: 3 labels: - "traefik.enable=true" + - "traefik.swarm.network=public" - "traefik.swarm.network=public" - "traefik.http.routers.mainio-api.entrypoints=web" - "traefik.http.routers.mainio-api.rule=Host(`mainio.lab`)" diff --git a/compose/swarm/docker-compose.n8n.yml b/compose/swarm/docker-compose.n8n.yml index cdb24ed..65abea9 100755 --- a/compose/swarm/docker-compose.n8n.yml +++ b/compose/swarm/docker-compose.n8n.yml @@ -29,6 +29,8 @@ services: - node.role == manager labels: - "traefik.enable=true" + - "traefik.swarm.network=public" + - "traefik.swarm.network=public" - "traefik.http.routers.n8n.rule=Host(`n8n.sidepiece.rip`)" - "traefik.http.routers.n8n.entrypoints=websecure" - "traefik.http.routers.n8n.tls.certresolver=letsencrypt" diff --git a/compose/swarm/docker-compose.unstructured.yml b/compose/swarm/docker-compose.unstructured.yml index 02151c4..97cc43c 100755 --- a/compose/swarm/docker-compose.unstructured.yml +++ b/compose/swarm/docker-compose.unstructured.yml @@ -29,6 +29,8 @@ services: memory: 2G labels: - "traefik.enable=true" + - "traefik.swarm.network=public" + - "traefik.swarm.network=public" - "traefik.http.routers.unstructured-api.rule=Host(`unstructured.sidepiece.rip`)" - "traefik.http.routers.unstructured-api.entrypoints=websecure" - "traefik.http.routers.unstructured-api.tls.certresolver=letsencrypt" diff --git a/docker-compose.yml b/docker-compose.yml index c32f2d8..df8716a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -69,6 +69,7 @@ services: constraints: [node.role == manager] labels: - "traefik.enable=true" + - "traefik.swarm.network=public" - "traefik.http.routers.portainer.rule=Host(`dock.toy`)" - "traefik.http.routers.portainer.entrypoints=web" - "traefik.http.services.portainer.loadbalancer.server.port=9000"