name: ctxd # Docker Compose reads .env automatically for variable substitution. # See .env.example for all available variables. # # IMPORTANT: Production uses PostgreSQL (DATABASE_URL host "postgres"). # Always start BOTH services: docker compose up -d # Or use: ./scripts/deploy.sh # Do NOT use docker compose up -d --no-deps ctxd unless postgres is already running. services: postgres: image: postgres:16-alpine container_name: ctxd-postgres restart: unless-stopped environment: POSTGRES_DB: ${POSTGRES_DB:-ctxd} POSTGRES_USER: ${POSTGRES_USER:-ctxd} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ctxd_local_dev} volumes: - ${CTXD_PG_DATA:-/mnt/ai-storage/projects/ctxd/data/pg}:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-ctxd}"] interval: 5s timeout: 5s retries: 5 ctxd: build: context: . dockerfile: Dockerfile container_name: ctxd restart: unless-stopped ports: - "${CTXD_PORT:-9091}:${CTXD_PORT:-9091}" volumes: - /mnt/ai-storage/projects/ctxd/data:/data:rw - /mnt/ai-storage/projects:/projects:ro - /home/overseer:/host:ro env_file: - .env environment: - CTXD_HOME=/data depends_on: postgres: condition: service_healthy