From ee0b129e350a6a3c98356fb138fc2080c4e37bce Mon Sep 17 00:00:00 2001 From: Nico Jensch Date: Sun, 5 Jan 2025 18:37:15 +0100 Subject: [PATCH] feat(chaotic-backend): restart on unhealthy state --- .envrc | 8 +++++++- docker-compose/chaotic-backend/docker-compose.yml | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.envrc b/.envrc index df99a55f..d93be8a1 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,7 @@ -use nix shell.nix +#!/usr/bin/env sh +# the shebang is ignored, but nice for editors +if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM=" +fi + +use flake \ No newline at end of file diff --git a/docker-compose/chaotic-backend/docker-compose.yml b/docker-compose/chaotic-backend/docker-compose.yml index e565c6cb..dc80b479 100644 --- a/docker-compose/chaotic-backend/docker-compose.yml +++ b/docker-compose/chaotic-backend/docker-compose.yml @@ -30,3 +30,17 @@ services: REDIS_SSH_USER: package-deployer ports: [3000:3000] volumes: [./sshkey:/app/sshkey] + + autoheal: + image: willfarrell/autoheal:latest + container_name: autoheal + deploy: + restart_policy: + condition: always + delay: 30s + environment: + AUTOHEAL_CONTAINER_LABEL: all + network_mode: none + volumes: + - /etc/localtime:/etc/localtime:ro + - /var/run/docker.sock:/var/run/docker.sock