From f3d641b77284ae5a3484a49300827ebfae4712e9 Mon Sep 17 00:00:00 2001 From: mdr223 Date: Thu, 7 Sep 2023 11:09:36 -0400 Subject: [PATCH] add volume to share data between scraper, chat, cleo --- deploy/compose.yaml | 10 ++++++++++ deploy/dev-install.sh | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/deploy/compose.yaml b/deploy/compose.yaml index 796fc06..69bb6be 100644 --- a/deploy/compose.yaml +++ b/deploy/compose.yaml @@ -25,6 +25,8 @@ services: - sender_user - sender_pw - openai_api_key + volumes: + - a2rchi-data:/root/data/ chat: build: @@ -34,6 +36,8 @@ services: OPENAI_API_KEY_FILE: /run/secrets/openai_api_key secrets: - openai_api_key + volumes: + - a2rchi-data:/root/data/ mailbox: build: @@ -74,6 +78,12 @@ services: build: context: .. dockerfile: deploy/scraper/Dockerfile-scraper + volumes: + - a2rchi-data:/root/data/ + +volumes: + a2rchi-data: + external: true secrets: imap_user: diff --git a/deploy/dev-install.sh b/deploy/dev-install.sh index e5308c2..d41c671 100755 --- a/deploy/dev-install.sh +++ b/deploy/dev-install.sh @@ -1,5 +1,12 @@ #!/bin/bash +# create volume if it doesn't already exist +exists=`docker volume ls | awk '{print $2}' | grep a2rchi-data` +if [[ $exists != 'a2rchi-data' ]]; then + docker volume create --name a2rchi-data +fi + +# start services echo "Starting docker compose" cd A2rchi/deploy/ docker compose up -d --build --force-recreate --always-recreate-deps