diff --git a/docker-compose.yml b/docker-compose.yml index 13201ce..9041002 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,22 @@ volumes: networks: n8n: +x-n8n: &service-n8n + image: n8nio/n8n:latest + networks: ['n8n'] + 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 + - EXTERNAL_HOOK_FILES=/hooks.js + links: + - postgres + x-ollama: &service-ollama image: ollama/ollama:latest container_name: ollama @@ -60,32 +76,35 @@ services: 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_PASSWORD} - - N8N_DIAGNOSTICS_ENABLED=false - - N8N_PERSONALIZATION_ENABLED=false - - N8N_ENCRYPTION_KEY - - N8N_USER_MANAGEMENT_JWT_SECRET - - EXTERNAL_HOOK_FILES=/hooks.js - ports: - - 5678:5678 - links: - - postgres + 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_storage:/home/node/.n8n - - ./n8n/hooks.js:/hooks.js + - ./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/hooks.js:/hooks.js + - ./n8n/backup:/backup + depends_on: + postgres: + condition: service_healthy + n8n-import: + condition: service_completed_successfully + qdrant: image: qdrant/qdrant container_name: qdrant diff --git a/n8n/backup/credentials/sFfERYppMeBnFNeA.json b/n8n/backup/credentials/sFfERYppMeBnFNeA.json new file mode 100644 index 0000000..a5ed746 --- /dev/null +++ b/n8n/backup/credentials/sFfERYppMeBnFNeA.json @@ -0,0 +1,14 @@ +{ + "createdAt": "2024-02-23T16:27:55.919Z", + "updatedAt": "2024-02-23T16:27:55.918Z", + "id": "sFfERYppMeBnFNeA", + "name": "QdrantApi account", + "data": "U2FsdGVkX18bm81Pk18TjmfyKEIbzd91Dt1O8pUPgTxVGk5v1mXp7MlE/3Fl+NHGTMBqa3u7RBS36wTQ74rijQ==", + "type": "qdrantApi", + "nodesAccess": [ + { + "nodeType": "@n8n/n8n-nodes-langchain.vectorStoreQdrant", + "date": "2024-02-23T16:27:55.918Z" + } + ] +} \ No newline at end of file diff --git a/n8n/backup/credentials/xHuYe0MDGOs9IpBW.json b/n8n/backup/credentials/xHuYe0MDGOs9IpBW.json new file mode 100644 index 0000000..0fbce82 --- /dev/null +++ b/n8n/backup/credentials/xHuYe0MDGOs9IpBW.json @@ -0,0 +1,18 @@ +{ + "createdAt": "2024-02-23T16:26:54.475Z", + "updatedAt": "2024-02-23T16:26:58.928Z", + "id": "xHuYe0MDGOs9IpBW", + "name": "Ollama account", + "data": "U2FsdGVkX18BVmjQBCdNKSrjr0GhmcTwMgG/rSWhncWtqOLPT62WnCIktky8RgM1PhH7vMkMc5EuUFIQA/eEZA==", + "type": "ollamaApi", + "nodesAccess": [ + { + "nodeType": "@n8n/n8n-nodes-langchain.lmChatOllama", + "date": "2024-02-23T16:26:58.927Z" + }, + { + "nodeType": "@n8n/n8n-nodes-langchain.lmOllama", + "date": "2024-02-23T16:26:58.927Z" + } + ] +} \ No newline at end of file diff --git a/n8n/backup/workflows/srOnR8PAY3u4RSwb.json b/n8n/backup/workflows/srOnR8PAY3u4RSwb.json new file mode 100644 index 0000000..26fc79d --- /dev/null +++ b/n8n/backup/workflows/srOnR8PAY3u4RSwb.json @@ -0,0 +1,86 @@ +{ + "createdAt": "2024-02-23T16:58:31.616Z", + "updatedAt": "2024-02-23T16:58:31.616Z", + "id": "srOnR8PAY3u4RSwb", + "name": "Demo workflow", + "active": false, + "nodes": [ + { + "parameters": {}, + "id": "74003dcd-2ac7-4caa-a1cd-adecc5143c07", + "name": "Chat Trigger", + "type": "@n8n/n8n-nodes-langchain.chatTrigger", + "typeVersion": 1, + "position": [ + 660, + 340 + ], + "webhookId": "cdb5c076-d458-4b9d-8398-f43bd25059b1" + }, + { + "parameters": {}, + "id": "ce8c3da4-899c-4cc4-af73-8096c64eec64", + "name": "Basic LLM Chain", + "type": "@n8n/n8n-nodes-langchain.chainLlm", + "typeVersion": 1.3, + "position": [ + 880, + 340 + ] + }, + { + "parameters": { + "options": {} + }, + "id": "3dee878b-d748-4829-ac0a-cfd6705d31e5", + "name": "Ollama Chat Model", + "type": "@n8n/n8n-nodes-langchain.lmChatOllama", + "typeVersion": 1, + "position": [ + 900, + 560 + ], + "credentials": { + "ollamaApi": { + "id": "xHuYe0MDGOs9IpBW", + "name": "Ollama account" + } + } + } + ], + "connections": { + "Chat Trigger": { + "main": [ + [ + { + "node": "Basic LLM Chain", + "type": "main", + "index": 0 + } + ] + ] + }, + "Ollama Chat Model": { + "ai_languageModel": [ + [ + { + "node": "Basic LLM Chain", + "type": "ai_languageModel", + "index": 0 + } + ] + ] + } + }, + "settings": { + "executionOrder": "v1" + }, + "staticData": null, + "meta": { + "templateCredsSetupCompleted": true + }, + "pinData": {}, + "versionId": "4e2affe6-bb1c-4ddc-92f9-dde0b7656796", + "triggerCount": 0, + "tags": [] +}