diff --git a/.gitignore b/.gitignore index 0cf96d9..31fa875 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ ovh.conf .env +test.js diff --git a/docker-compose.yaml b/docker-compose.yaml index d354436..7a579e5 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,5 +1,5 @@ services: - ollama-service: + ollama-service-1: restart: always image: ollama/ollama tty: true @@ -19,7 +19,7 @@ services: runtime: nvidia ipc: host deploy: - replicas: 2 + # replicas: 2 resources: reservations: devices: @@ -27,7 +27,39 @@ services: count: 1 capabilities: [gpu] volumes: - - "./.ollama:/root/.ollama" + - "./.ollama-service-1:/root/.ollama" + networks: + - ollama-network + + ollama-service-2: + restart: always + image: ollama/ollama + tty: true + expose: + - "11434" + labels: + - "traefik.enable=true" + - "traefik.http.routers.ollama-service.rule=Host(`${HOST}.nip.io`)" + - "traefik.http.routers.ollama-service.entrypoints=websecure" + - "traefik.http.routers.ollama-service.tls.certresolver=myresolver" + - "traefik.http.middlewares.main-auth.basicauth.users=${CREDENTIALS}" + - "traefik.http.routers.ollama-service.middlewares=main-auth@docker" + - "traefik.http.services.ollama-service.loadbalancer.server.port=11434" + environment: + OLLAMA_KEEP_ALIVE: "-1" + VERBOSE: "${VERBOSE:-0}" + runtime: nvidia + ipc: host + deploy: + # replicas: 2 + resources: + reservations: + devices: + - driver: nvidia + count: 1 + capabilities: [gpu] + volumes: + - "./.ollama-service-2:/root/.ollama" networks: - ollama-network diff --git a/main.py b/main.py index 621d8a4..dae55ae 100644 --- a/main.py +++ b/main.py @@ -119,6 +119,7 @@ def indentString(input_string, indent_level=4): # up docker compose services docker compose up -d --build docker exec ollama-ollama-service-1 ollama pull {modelName} + docker exec ollama-ollama-service-2 ollama pull {modelName} touch /tmp/runcmd_finished - path: /etc/ssh/sshd_config.d/90-custom-settings.conf