4NK_IA_back/infra/docker-compose.yml
root bf2c0901f4 feat: Organisation des scripts et amélioration de l'installation
- Création du répertoire scripts/ avec tous les scripts d'installation et de test
- Scripts d'installation automatique (install.sh, quick-start.sh)
- Scripts de maintenance complète (maintenance.sh)
- Scripts de test (test-installation.sh, test-api.sh, test-services.sh, test-integration.sh)
- Amélioration du Dockerfile avec healthchecks et sécurité
- Mise à jour du docker-compose.yml avec healthchecks et dépendances
- Makefile étendu avec nouvelles commandes
- Documentation complète mise à jour
- Fichier de configuration d'exemple (env.example)
- app.py corrigé et fonctionnel
2025-09-11 00:41:57 +02:00

188 lines
4.4 KiB
YAML

x-env: &default-env
TZ: ${TZ}
PUID: "1000"
PGID: "1000"
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
redis:
image: redis:7
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis:/data
restart: unless-stopped
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
volumes:
- minio:/data
ports:
- "9000:9000"
- "9001:9001"
restart: unless-stopped
anythingsqlite:
image: mintplexlabs/anythingllm:latest
environment:
- DISABLE_AUTH=true
depends_on:
- ollama
ports:
- "3001:3001"
volumes:
- anythingllm:/app/server/storage
container_name: anythingllm
restart: unless-stopped
ollama:
image: ollama/ollama:latest
volumes:
- ollama:/root/.ollama
ports:
- "11434:11434"
restart: unless-stopped
neo4j:
image: neo4j:5
environment:
- NEO4J_AUTH=${NEO4J_AUTH}
volumes:
- neo4j:/data
ports:
- "7474:7474"
- "7687:7687"
restart: unless-stopped
opensearch:
image: opensearchproject/opensearch:2.14.0
environment:
- discovery.type=single-node
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD}
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- opensearch:/usr/share/opensearch/data
ports:
- "9200:9200"
restart: unless-stopped
host-api:
build:
context: ../docker/host-api
dockerfile: Dockerfile
env_file: ./.env
environment:
<<: *default-env
DATABASE_URL: postgresql+psycopg://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$POSTGRES_DB
REDIS_URL: redis://redis:6379/0
MINIO_ENDPOINT: minio:9000
MINIO_BUCKET: ${MINIO_BUCKET}
ANYLLM_BASE_URL: ${ANYLLM_BASE_URL}
ANYLLM_API_KEY: ${ANYLLM_API_KEY}
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL}
OPENSEARCH_URL: http://opensearch:9200
NEO4J_URL: bolt://neo4j:7687
NEO4J_AUTH: ${NEO4J_AUTH}
# Configuration de l'API
API_HOST: 0.0.0.0
API_PORT: 8000
API_WORKERS: 4
LOG_LEVEL: ${LOG_LEVEL:-INFO}
LOG_FORMAT: ${LOG_FORMAT:-json}
# Sécurité
SECRET_KEY: ${SECRET_KEY:-your_secret_key_here}
ACCESS_TOKEN_EXPIRE_MINUTES: ${ACCESS_TOKEN_EXPIRE_MINUTES:-30}
volumes:
- ../services/host_api:/app
- ../ops/seed:/seed:ro
- ../ops/seed/schemas:/schemas:ro
- api_logs:/app/logs
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
minio:
condition: service_started
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
worker:
build:
context: ../
dockerfile: docker/worker/Dockerfile
env_file: ./.env
environment:
<<: *default-env
DATABASE_URL: postgresql+psycopg://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$POSTGRES_DB
REDIS_URL: redis://redis:6379/0
MINIO_ENDPOINT: minio:9000
MINIO_BUCKET: ${MINIO_BUCKET}
ANYLLM_BASE_URL: ${ANYLLM_BASE_URL}
ANYLLM_API_KEY: ${ANYLLM_API_KEY}
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL}
OPENSEARCH_URL: http://opensearch:9200
NEO4J_URL: bolt://neo4j:7687
NEO4J_AUTH: ${NEO4J_AUTH}
volumes:
- ../services/worker:/app
- ../ops/seed:/seed:ro
depends_on:
- host-api
restart: unless-stopped
prometheus:
image: prom/prometheus:v2.54.1
volumes:
- prometheus:/prometheus
restart: unless-stopped
grafana:
image: grafana/grafana:11.1.0
volumes:
- grafana:/var/lib/grafana
- ../services/charts:/var/lib/grafana/dashboards:ro
ports:
- "3000:3000"
restart: unless-stopped
volumes:
pgdata:
redis:
minio:
ollama:
neo4j:
opensearch:
prometheus:
grafana:
anythingllm:
api_logs: