Files
ai_env/docker-compose.yml
2025-08-21 21:53:39 +02:00

135 lines
2.9 KiB
YAML

services:
ollama:
image: ollama/ollama
volumes:
- ollama:/root/.ollama
restart: unless-stopped
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
healthcheck:
test: ollama --version && ollama ps || exit 1
interval: 60s
retries: 5
start_period: 20s
timeout: 10s
networks:
- nointernet
ollama_provision:
build:
dockerfile: src/ollama_provision/Dockerfile
environment:
- MODELS=nomic-embed-text,llama3.1:8b,qwen2.5:7b,gemma3:12b-it-qat,gemma3:27b-it-qat,gpt-oss:20b
volumes:
- ollama:/root/.ollama
restart: no
depends_on:
ollama:
condition: service_healthy
restart: true
links:
- ollama
networks:
- internet
speaches-ai:
image: ghcr.io/speaches-ai/speaches:latest-cuda
restart: unless-stopped
volumes:
- hf-hub-cache:/home/ubuntu/.cache/huggingface/hub
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
healthcheck:
test: curl --fail http://localhost:8000 || exit 1
interval: 60s
retries: 5
start_period: 10s
timeout: 10s
networks:
- nointernet
speaches-ai_provision:
build:
dockerfile: src/speaches-ai_provision/Dockerfile
volumes:
- hf-hub-cache:/home/ubuntu/.cache/huggingface/hub
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
restart: no
networks:
- internet
aichat:
build:
dockerfile: src/aichat/Dockerfile
restart: unless-stopped
environment:
- API_KEY=${LLM_API_KEY}
depends_on:
- ollama
links:
- ollama
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8000' || exit 1
interval: 30s
timeout: 15s
retries: 3
networks:
- nointernet
nginx:
image: nginx
volumes:
- ./src/nginx/nginx.conf:/etc/nginx/templates/nginx.conf.template
- ./src/nginx/htpasswd:/etc/nginx/.htpasswd
environment:
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
- API_KEY=${LLM_API_KEY}
depends_on:
- ollama
- speaches-ai
- aichat
links:
- ollama
- speaches-ai
- aichat
ports:
- "127.0.0.1:10434:10434"
- "127.0.0.1:8000:8000"
- "127.0.0.1:8001:8001"
healthcheck:
test: curl --fail http://localhost:11434 || exit 1
interval: 10s
retries: 5
start_period: 10s
timeout: 10s
restart: unless-stopped
networks:
- internet
- nointernet
volumes:
ollama:
hf-hub-cache:
networks:
internet:
internal: false
nointernet:
internal: true