From 9f6b8651f47aaf07d6231bfd2022d53e21072bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Fri, 23 Feb 2024 15:08:06 +0100 Subject: [PATCH] add initial docker compose setup --- .env | 3 ++ docker-compose.yml | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .env create mode 100644 docker-compose.yml diff --git a/.env b/.env new file mode 100644 index 0000000..10dad0f --- /dev/null +++ b/.env @@ -0,0 +1,3 @@ +POSTGRES_USER=root +POSTGRES_PASSWORD=password +POSTGRES_DB=n8n diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c5b9dec --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,76 @@ +version: '3.8' +volumes: + n8n_storage: + postgres_storage: + ollama_storage: + qdrant_storage: + +networks: + n8n: + +services: + postgres: + image: postgres:16-alpine + container_name: postgres + networks: ['n8n'] + restart: unless-stopped + environment: + - POSTGRES_USER + - POSTGRES_PASSWORD + - POSTGRES_DB + volumes: + - postgres_storage:/var/lib/postgresql/data + ports: + - 5432:5432 + healthcheck: + test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}'] + interval: 5s + timeout: 5s + retries: 10 + + n8n: + image: n8nio/n8n:latest + container_name: n8n + networks: ['n8n'] + restart: unless-stopped + environment: + - DB_TYPE=postgresdb + - DB_POSTGRESDB_HOST=postgres + - DB_POSTGRESDB_USER=${POSTGRES_USER} + - DB_POSTGRESDB_PASSWORD=${POSTGRES_DB} + ports: + - 5678:5678 + links: + - postgres + volumes: + - n8n_storage:/home/node/.n8n + depends_on: + postgres: + condition: service_healthy + + ollama: + image: ollama/ollama:latest + container_name: ollama + networks: ['n8n'] + restart: unless-stopped + ports: + - 11434:11434 + volumes: + - ollama_storage:/root/.ollama + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: 1 + capabilities: [gpu] + + qdrant: + image: qdrant/qdrant + container_name: qdrant + networks: ['n8n'] + restart: unless-stopped + ports: + - 6333:6333 + volumes: + - qdrant_storage:/qdrant/storage