From d90c3110cff1aa55ffc409e676cc793ad860db5e Mon Sep 17 00:00:00 2001 From: Sasank Chilamkurthy Date: Tue, 19 Nov 2024 23:27:15 +0530 Subject: [PATCH] Fail entrypoint if migration fails (#8590) If migration fails for some reason, the script runs anyway and creates the file which indicates that migration is complete. This is obviously not cool. If database is not available for some reason and migrations fail, the container should exit, not continue. Relevant stack overflow: https://stackoverflow.com/a/2871034 --- packages/twenty-docker/twenty/entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/twenty-docker/twenty/entrypoint.sh b/packages/twenty-docker/twenty/entrypoint.sh index c6844ec739..331a463602 100755 --- a/packages/twenty-docker/twenty/entrypoint.sh +++ b/packages/twenty-docker/twenty/entrypoint.sh @@ -1,4 +1,5 @@ #!/bin/sh +set -e # Check if the initialization has already been done and that we enabled automatic migration if [ "${ENABLE_DB_MIGRATIONS}" = "true" ] && [ ! -f /app/docker-data/db_status ]; then