SPB Git

Repository Public

docker-compose.yml 2.1 KB 58 lines yaml

1# CLIP on a single Linux host. Not what production uses (PM2 on macOS, see docs/deployment.md) and not exercised2# by the test suite: treat it as the documented starting point for a container deployment.3#   cp .env.example .env   # fill XAI_API_KEY, APP_SECRET, OWNER_EMAIL, POSTGRES_PASSWORD4#   docker compose up -d --build5#   docker compose run --rm web pnpm exec tsx scripts/bootstrap-owner.ts6# Scale workers with: docker compose up -d --scale worker=3 (they share PostgreSQL, Redis and the assets volume).7x-app: &app8  build: .9  env_file: .env10  environment:11    DATABASE_URL: postgres://clip_app:${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}@postgres:5432/clip12    REDIS_URL: redis://redis:6379/013    ASSET_ROOT: /data/assets14    BACKUP_DIR: /data/backups15  volumes:16    - assets:/data17  depends_on:18    postgres: { condition: service_healthy }19    redis: { condition: service_healthy }20  restart: unless-stopped2122services:23  migrate:24    <<: *app25    command: sh -c "pnpm exec tsx scripts/migrate.ts && pnpm exec tsx scripts/seed.ts"26    restart: "no"27  web:28    <<: *app29    ports: ["127.0.0.1:8640:8640"]   # put a TLS reverse proxy (Caddy, nginx) in front30    healthcheck:31      test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:8640/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]32      interval: 30s33      timeout: 5s34      retries: 335  worker:36    <<: *app37    command: ["node", "node_modules/tsx/dist/cli.mjs", "src/worker/index.ts"]38  postgres:39    image: postgres:1740    environment:41      POSTGRES_USER: clip_app42      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}43      POSTGRES_DB: clip44    volumes: ["pgdata:/var/lib/postgresql/data"]45    healthcheck: { test: ["CMD-SHELL", "pg_isready -U clip_app -d clip"], interval: 10s, timeout: 3s, retries: 5 }46    restart: unless-stopped47  redis:48    image: redis:849    command: ["redis-server", "--appendonly", "yes", "--maxmemory-policy", "noeviction"]50    volumes: ["redisdata:/data"]51    healthcheck: { test: ["CMD", "redis-cli", "ping"], interval: 10s, timeout: 3s, retries: 5 }52    restart: unless-stopped5354volumes:55  assets:56  pgdata:57  redisdata:58
Files main
Menu

Theme