Files
CTXD/app/docker-compose.yml
T
overseer 9e85c1b8ec ops: prevent 502 from ctxd without postgres
- entrypoint: wait for DATABASE_URL (CTXD_PG_WAIT_SECONDS) with clear fatal message
- scripts/deploy.sh: postgres healthy then force-recreate ctxd
- compose + README: ban --no-deps ctxd as default; 502 troubleshooting
2026-06-25 13:59:51 +00:00

46 lines
1.3 KiB
YAML

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