version: '3.8' services: portainer: image: portainer/portainer-ce:latest container_name: portainer restart: always ports: - "8000:8000" - "9000:9000" - "9443:9443" volumes: - /var/run/docker.sock:/var/run/docker.sock - portainer_data:/data environment: - TZ=Europe/Tallinn networks: - ai_network postgres: image: kartoza/postgis:16 container_name: postgres_postgis restart: always ports: - "5432:5432" environment: POSTGRES_USER: ai_user POSTGRES_PASSWORD: ai_secure_pass_2026 POSTGRES_DB: research_db POSTGRES_INITDB_ARGS: "-c shared_buffers=256MB -c max_connections=200" PGDATA: /var/lib/postgresql/data/pgdata TZ: Europe/Tallinn volumes: - postgres_data:/var/lib/postgresql/data - ./init-db:/docker-entrypoint-initdb.d healthcheck: test: ["CMD-SHELL", "pg_isready -U ai_user -d research_db"] interval: 10s timeout: 5s retries: 5 networks: - ai_network weaviate: image: semitechnologies/weaviate:latest container_name: weaviate restart: always ports: - "8080:8080" - "50051:50051" environment: QUERY_DEFAULTS_LIMIT: 25 AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true' PERSISTENCE_DATA_PATH: '/var/lib/weaviate' DEFAULT_VECTORIZER_MODULE: 'none' CLUSTER_HOSTNAME: 'weaviate' volumes: - weaviate_data:/var/lib/weaviate networks: - ai_network ollama: image: ollama/ollama:latest container_name: ollama restart: always ports: - "11434:11434" volumes: - ollama_data:/root/.ollama environment: - OLLAMA_HOST=0.0.0.0:11434 - NVIDIA_VISIBLE_DEVICES=all - CUDA_VISIBLE_DEVICES=0 devices: - /dev/kfd:/dev/kfd - /dev/dri:/dev/dri networks: - ai_network jupyter: image: jupyter/datascience-notebook:latest container_name: jupyter restart: always ports: - "8888:8888" environment: - JUPYTER_ENABLE_LAB=yes - JUPYTER_TOKEN=ai_server_2026 - TZ=Europe/Tallinn volumes: - ./notebooks:/home/jovyan/work - ./data:/home/jovyan/data - jupyter_data:/home/jovyan/.jupyter networks: - ai_network command: start-notebook.sh --NotebookApp.token='ai_server_2026' --NotebookApp.allow_root=True # ROCm PyTorch - GPU-kiirendatud ML/DL rocm-pytorch: image: rocm/pytorch:latest container_name: rocm_pytorch restart: always ports: - "8889:8888" - "6006:6006" environment: - HSA_OVERRIDE_GFX_VERSION=11.5.1 - PYTORCH_ROCM_ARCH=gfx1151 - ROCM_HOME=/opt/rocm - TZ=Europe/Tallinn - TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 # ← UUS! devices: - /dev/kfd:/dev/kfd - /dev/dri:/dev/dri volumes: - ./pytorch-workspace:/workspace - ./models:/models - ./data:/data - rocm_pytorch_data:/root/.cache working_dir: /workspace cap_add: - SYS_PTRACE security_opt: - seccomp=unconfined ipc: host shm_size: 8G group_add: - video networks: - ai_network command: > bash -c "pip install jupyter notebook tensorboard transformers datasets huggingface_hub scikit-learn pandas psycopg2-binary && jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token='ai_pytorch_2026'" # ===== RAG API ===== rag-api: #image: rag-api:latest build: #context: /home/ardo/rag-demo/pdf-pipeline context: /opt/docker-compose/rag-api dockerfile: Dockerfile container_name: rag_api restart: always ports: - "8072:8000" environment: LLAMA_CPP_URL: http://100.87.1.24:8070/completion WEAVIATE_HOST: weaviate WEAVIATE_HTTP_PORT: 8080 WEAVIATE_URL: http://weaviate:8080 WEAVIATE_CLASS: ScientificArticle DB_HOST: postgres DB_PORT: 5432 DB_NAME: pdf_research DB_USER: osm DB_PASSWORD: osm OLLAMA_URL: http://ollama:11434 TZ: Europe/Tallinn volumes: - /home/ardo/rag-demo/pdf-pipeline/src:/app/src - /home/ardo/rag-demo/pdf-pipeline/data:/app/data - /home/ardo/rag-demo/pdf-pipeline/output:/app/output depends_on: - weaviate - ollama - postgres networks: - ai_network healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/docs"] interval: 30s timeout: 10s retries: 3 start_period: 40s volumes: portainer_data: driver: local postgres_data: driver: local weaviate_data: driver: local ollama_data: driver: local jupyter_data: driver: local rocm_pytorch_data: driver: local networks: ai_network: driver: bridge