version: "3.9" # .env has QDRANT_HOST/REDIS_HOST/NEO4J_URI/CELERY_* set to localhost, which is # correct for running the app directly on the host against forwarded ports but # wrong inside these containers (localhost there means the container itself, # not its sibling containers). environment: overrides env_file: for the same # key, so this repoints them at the compose service DNS names without having # to touch .env. x-container-env: &container-env QDRANT_HOST: qdrant REDIS_HOST: redis NEO4J_URI: bolt://neo4j:7687 DATABASE_URL: postgresql://engram:engram_dev_password@postgres:5432/engram CELERY_BROKER_URL: redis://redis:6379/1 CELERY_RESULT_BACKEND: redis://redis:6379/2 services: postgres: image: postgres:16-alpine environment: - POSTGRES_USER=engram - POSTGRES_PASSWORD=engram_dev_password - POSTGRES_DB=engram ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data # The API calls init_schema() at startup, so it needs Postgres actually # accepting connections — not merely started, which is all a bare # depends_on guarantees. healthcheck: test: ["CMD-SHELL", "pg_isready -U engram -d engram"] interval: 5s timeout: 3s retries: 10 qdrant: image: qdrant/qdrant:v1.19.0 ports: - "6333:6333" - "6334:6334" volumes: - qdrant_data:/qdrant/storage redis: image: redis:7-alpine ports: - "6379:6379" command: ["redis-server", "--appendonly", "yes"] volumes: - redis_data:/data neo4j: image: neo4j:5 ports: - "7474:7474" - "7687:7687" environment: - NEO4J_AUTH=neo4j/engram_dev_password - NEO4J_PLUGINS=["apoc"] volumes: - neo4j_data:/data api: build: . ports: - "8000:8000" env_file: - .env environment: <<: *container-env depends_on: postgres: condition: service_healthy qdrant: condition: service_started redis: condition: service_started neo4j: condition: service_started volumes: - ./app:/app/app celery_worker: build: . command: celery -A app.workers.celery_app worker --loglevel=info --pool=solo env_file: - .env environment: <<: *container-env depends_on: postgres: condition: service_healthy qdrant: condition: service_started redis: condition: service_started neo4j: condition: service_started volumes: - ./app:/app/app celery_beat: build: . command: celery -A app.workers.celery_app beat --loglevel=info env_file: - .env environment: <<: *container-env depends_on: postgres: condition: service_healthy qdrant: condition: service_started redis: condition: service_started neo4j: condition: service_started volumes: - ./app:/app/app volumes: qdrant_data: redis_data: neo4j_data: postgres_data: