2025-01-09 15:47:25 +05:30
|
|
|
version: '3.8'
|
|
|
|
|
2025-03-18 13:41:39 -05:00
|
|
|
x-ollama-check: &ollama-check
|
|
|
|
# This command reads the toml file and checks if any provider is set to "ollama"
|
|
|
|
command: >
|
|
|
|
/bin/sh -c '
|
|
|
|
grep -q "provider *= *\"ollama\"" databridge.toml &&
|
|
|
|
echo "true" > /tmp/needs_ollama ||
|
|
|
|
echo "false" > /tmp/needs_ollama'
|
|
|
|
|
2025-01-09 15:47:25 +05:30
|
|
|
services:
|
2025-03-18 13:41:39 -05:00
|
|
|
config-check:
|
|
|
|
image: alpine
|
|
|
|
volumes:
|
|
|
|
- ./databridge.toml:/databridge.toml
|
|
|
|
<<: *ollama-check
|
|
|
|
|
2025-01-09 15:47:25 +05:30
|
|
|
databridge:
|
|
|
|
build: .
|
|
|
|
ports:
|
|
|
|
- "8000:8000"
|
|
|
|
environment:
|
|
|
|
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-your-secret-key-here}
|
|
|
|
- POSTGRES_URI=postgresql+asyncpg://databridge:databridge@postgres:5432/databridge
|
|
|
|
- PGPASSWORD=databridge
|
|
|
|
- HOST=0.0.0.0
|
|
|
|
- PORT=8000
|
|
|
|
- LOG_LEVEL=DEBUG
|
|
|
|
volumes:
|
|
|
|
- ./storage:/app/storage
|
|
|
|
- ./logs:/app/logs
|
|
|
|
- ./databridge.toml:/app/databridge.toml
|
2025-03-18 13:41:39 -05:00
|
|
|
- huggingface_cache:/root/.cache/huggingface
|
2025-01-09 15:47:25 +05:30
|
|
|
depends_on:
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
2025-03-18 13:41:39 -05:00
|
|
|
config-check:
|
|
|
|
condition: service_completed_successfully
|
2025-01-09 15:47:25 +05:30
|
|
|
ollama:
|
|
|
|
condition: service_started
|
2025-03-18 13:41:39 -05:00
|
|
|
required: false
|
2025-01-09 15:47:25 +05:30
|
|
|
networks:
|
|
|
|
- databridge-network
|
2025-01-22 09:12:12 -05:00
|
|
|
env_file:
|
|
|
|
- .env
|
2025-01-09 15:47:25 +05:30
|
|
|
|
|
|
|
postgres:
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: postgres.dockerfile
|
|
|
|
shm_size: 128mb
|
|
|
|
environment:
|
|
|
|
- POSTGRES_USER=databridge
|
|
|
|
- POSTGRES_PASSWORD=databridge
|
|
|
|
- POSTGRES_DB=databridge
|
|
|
|
- PGDATA=/var/lib/postgresql/data/pgdata
|
|
|
|
ports:
|
|
|
|
- "5432:5432"
|
|
|
|
volumes:
|
|
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U databridge -d databridge"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
|
|
|
start_period: 10s
|
|
|
|
networks:
|
|
|
|
- databridge-network
|
|
|
|
|
|
|
|
ollama:
|
|
|
|
image: ollama/ollama:latest
|
2025-03-18 13:41:39 -05:00
|
|
|
profiles:
|
|
|
|
- ollama
|
2025-01-09 15:47:25 +05:30
|
|
|
ports:
|
|
|
|
- "11434:11434"
|
|
|
|
volumes:
|
|
|
|
- ollama_data:/root/.ollama
|
|
|
|
- ./ollama-entrypoint.sh:/ollama-entrypoint.sh
|
|
|
|
networks:
|
|
|
|
- databridge-network
|
|
|
|
entrypoint: ["/ollama-entrypoint.sh"]
|
|
|
|
|
|
|
|
networks:
|
|
|
|
databridge-network:
|
|
|
|
driver: bridge
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
postgres_data:
|
2025-03-18 13:41:39 -05:00
|
|
|
ollama_data:
|
|
|
|
huggingface_cache:
|