Created
November 2, 2024 10:30
-
-
Save gamersalpha/65f4b0d116c9fb58a2b822c836abb154 to your computer and use it in GitHub Desktop.
Docker local AI - OLLAMA - WEBOPENAI - and many stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
volumes: | |
n8n_storage: | |
postgres_storage: | |
ollama_storage: | |
qdrant_storage: | |
open-webui: | |
networks: | |
net_ai: | |
x-n8n: &service-n8n | |
image: n8nio/n8n:latest | |
networks: ['net_ai'] | |
environment: | |
- DB_TYPE=postgresdb | |
- DB_POSTGRESDB_HOST=postgres | |
- DB_POSTGRESDB_USER=${POSTGRES_USER} | |
- DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD} | |
- N8N_DIAGNOSTICS_ENABLED=false | |
- N8N_PERSONALIZATION_ENABLED=false | |
- N8N_ENCRYPTION_KEY | |
- N8N_USER_MANAGEMENT_JWT_SECRET | |
- WEBHOOK_URL=http://VOTRE_NOM_DE_DOMAINE/ | |
links: | |
- postgres | |
x-ollama: &service-ollama | |
image: ollama/ollama:latest | |
container_name: ollama | |
networks: ['net_ai'] | |
restart: unless-stopped | |
ports: | |
- 11434:11434 | |
volumes: | |
- ollama_storage:/root/.ollama | |
x-init-ollama: &init-ollama | |
image: ollama/ollama:latest | |
networks: ['net_ai'] | |
container_name: ollama-pull-llama | |
volumes: | |
- ollama_storage:/root/.ollama | |
entrypoint: /bin/sh | |
command: | |
- "-c" | |
- "sleep 3; OLLAMA_HOST=ollama:11434 ollama pull llama3.1; OLLAMA_HOST=ollama:11434 ollama pull nomic-embed-text" | |
services: | |
open-webui: | |
image: ghcr.io/open-webui/open-webui:main | |
networks: ['net_ai'] | |
restart: unless-stopped | |
container_name: open-webui | |
environment: | |
- 'OLLAMA_BASE_URL=http://ollama:11434' | |
- 'WEBUI_SECRET_KEY=' | |
ports: | |
- "3000:8080" | |
extra_hosts: | |
- "host.docker.internal:host-gateway" | |
volumes: | |
- open-webui:/app/backend/data | |
postgres: | |
image: postgres:16-alpine | |
networks: ['net_ai'] | |
restart: unless-stopped | |
ports: | |
- 5432:5432 | |
environment: | |
- POSTGRES_USER | |
- POSTGRES_PASSWORD | |
- POSTGRES_DB | |
volumes: | |
- postgres_storage:/var/lib/postgresql/data | |
healthcheck: | |
test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}'] | |
interval: 5s | |
timeout: 5s | |
retries: 10 | |
n8n-import: | |
<<: *service-n8n | |
container_name: n8n-import | |
entrypoint: /bin/sh | |
command: | |
- "-c" | |
- "n8n import:credentials --separate --input=/backup/credentials && n8n import:workflow --separate --input=/backup/workflows" | |
volumes: | |
- ./n8n/backup:/backup | |
depends_on: | |
postgres: | |
condition: service_healthy | |
n8n: | |
<<: *service-n8n | |
container_name: n8n | |
restart: unless-stopped | |
ports: | |
- 5678:5678 | |
volumes: | |
- n8n_storage:/home/node/.n8n | |
- ./n8n/backup:/backup | |
- ./shared:/data/shared | |
depends_on: | |
postgres: | |
condition: service_healthy | |
n8n-import: | |
condition: service_completed_successfully | |
qdrant: | |
image: qdrant/qdrant | |
container_name: qdrant | |
networks: ['net_ai'] | |
restart: unless-stopped | |
ports: | |
- 6333:6333 | |
volumes: | |
- qdrant_storage:/qdrant/storage | |
ollama-cpu: | |
profiles: ["cpu"] | |
<<: *service-ollama | |
ollama-gpu: | |
profiles: ["gpu-nvidia"] | |
<<: *service-ollama | |
deploy: | |
resources: | |
reservations: | |
devices: | |
- driver: nvidia | |
count: 1 | |
capabilities: [gpu] | |
ollama-pull-llama-cpu: | |
profiles: ["cpu"] | |
<<: *init-ollama | |
depends_on: | |
- ollama-cpu | |
ollama-pull-llama-gpu: | |
profiles: ["gpu-nvidia"] | |
<<: *init-ollama | |
depends_on: | |
- ollama-gpu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment