From 48018990bee282e6ce4599873d0f618db8bb3319 Mon Sep 17 00:00:00 2001 From: Hristo <53634432+izo0x90@users.noreply.github.com> Date: Thu, 16 May 2024 09:53:33 -0400 Subject: [PATCH] Ensure containers are brought backup when exiting on error This is esp. important for the NodeJS (backend) container as Node will exit on any unhandled error, it is best practice to let the errored process crash and start a new one in its place. It this case we use docker to do that for us (`restart: always` policy) --- docker-compose.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 9faa891..0ed889f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,6 +3,7 @@ services: build: context: . dockerfile: searxng.dockerfile + restart: always expose: - 4000 ports: @@ -16,12 +17,17 @@ services: dockerfile: backend.dockerfile args: - SEARXNG_API_URL=null + restart: always + volumes: + - "/Volumes/keys/headllamp/keys/:/var/keys/" + - "${GOOGLE_APPLICATION_CREDENTIALS}:/var/keys/gcp_service_account.json" environment: SEARXNG_API_URL: 'http://searxng:8080' SUPER_SECRET_KEY: ${SUPER_SECRET_KEY} OPENAI: ${OPENAI} GROQ: ${GROQ} OLLAMA_API_URL: ${OLLAMA_API_URL} + GOOGLE_APPLICATION_CREDENTIALS: /var/keys/gcp_service_account.json depends_on: - searxng expose: