diff --git a/.gitignore b/.gitignore index e1c0c55..eff81ec 100644 --- a/.gitignore +++ b/.gitignore @@ -10,9 +10,6 @@ __pycache__/ *.pdb # Docker -docker-compose.override.yml -docker-compose.*.yml -docker-compose.yml *.log *.pid *.seed diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2abdc76 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,77 @@ +services: + ollama: + volumes: + - ollama:/root/.ollama + - ./scripts/ollama.sh:/entrypoint.sh + environment: + - MODELS_BASE=${MODELS_BASE} + # Visit https://ollama.com/search for a list of + # available models and add to the MODELS_EXTRA array in .env + - MODELS_EXTRA=${MODELS_EXTRA} + container_name: ollama + pull_policy: always + tty: true + restart: unless-stopped + network_mode: host + image: ollama/ollama:latest + entrypoint: ["/usr/bin/bash", "/entrypoint.sh"] + + open-webui: + image: ghcr.io/open-webui/open-webui:latest + container_name: open-webui + volumes: + - open-webui:/app/backend/data + - open-webui-data:/app/data + - ./scripts/openwebui.sh:/app/backend/openwebui.sh + environment: + - DATA_DIR=/app/data + - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DATABASE} + - NVIDIA_VISIBLE_DEVICES=all + - WEBUI_NAME=AIXCL + - "OLLAMA_BASE_URL=http://localhost:11434" + - OPENWEBUI_EMAIL=${OPENWEBUI_EMAIL} + - OPENWEBUI_PASSWORD=${OPENWEBUI_PASSWORD} + depends_on: + - postgres + - ollama + network_mode: host + restart: always + command: ["/bin/bash", "-c", "chmod +x openwebui.sh && bash openwebui.sh"] + + postgres: + image: postgres:latest + container_name: postgres + environment: + POSTGRES_USER: $POSTGRES_USER + POSTGRES_PASSWORD: $POSTGRES_PASSWORD + POSTGRES_DB: $POSTGRES_DATABASE + volumes: + - postgres-data:/var/lib/postgresql/data + network_mode: host + restart: always + + pgadmin: + image: dpage/pgadmin4 + container_name: pgadmin + environment: + PGADMIN_DEFAULT_EMAIL: $PGADMIN_EMAIL + PGADMIN_DEFAULT_PASSWORD: $PGADMIN_PASSWORD + PGADMIN_LISTEN_PORT: 5050 + network_mode: host + depends_on: + - postgres + restart: always + + watchtower: + image: containrrr/watchtower + container_name: watchtower + volumes: + - /var/run/docker.sock:/var/run/docker.sock + command: open-webui + restart: always + +volumes: + ollama: + open-webui: + open-webui-data: + postgres-data: