diff --git a/abra.sh b/abra.sh index d6b8d09..11d55fb 100755 --- a/abra.sh +++ b/abra.sh @@ -5,4 +5,5 @@ export NGINX_CONF_VERSION=v1 export TAIGA_ENTRYPOINT_VERSION=v1 export TAIGA_EVENTS_ENTRYPOINT_VERSION=v1 export CREATE_SUPERUSER_VERSION=v1 -export PG_BACKUP_VERSION=v1 \ No newline at end of file +export PG_BACKUP_VERSION=v1 +export NGINX_ENTRYPOINT_VERSION=v1 \ No newline at end of file diff --git a/compose.yml b/compose.yml index c08f176..b9d3901 100644 --- a/compose.yml +++ b/compose.yml @@ -142,6 +142,12 @@ services: - taiga-async-rabbitmq-data:/var/lib/rabbitmq networks: - internal + healthcheck: + test: rabbitmq-diagnostics -q ping + interval: 30s + timeout: 10s + retries: 10 + start_period: 1m taiga-front: image: taigaio/taiga-front:6.9.0 @@ -215,6 +221,10 @@ services: configs: - source: nginx_conf target: /etc/nginx/conf.d/default.conf + - source: nginx_entrypoint + target: /custom-entrypoint.sh + mode: 0555 + entrypoint: /custom-entrypoint.sh volumes: - taiga-static-data:/taiga/static - taiga-media-data:/taiga/media @@ -265,6 +275,10 @@ configs: name: ${STACK_NAME}_taiga_events_entrypoint_${TAIGA_EVENTS_ENTRYPOINT_VERSION} file: entrypoint-events.sh.tmpl template_driver: golang + nginx_entrypoint: + name: ${STACK_NAME}_nginx_entrypoint_${NGINX_ENTRYPOINT_VERSION} + file: entrypoint-nginx.sh.tmpl + template_driver: golang create_superuser: name: ${STACK_NAME}_create_superuser_${CREATE_SUPERUSER_VERSION} file: create-superuser.sh.tmpl diff --git a/entrypoint-events.sh.tmpl b/entrypoint-events.sh.tmpl index a94443c..ba546b3 100644 --- a/entrypoint-events.sh.tmpl +++ b/entrypoint-events.sh.tmpl @@ -30,6 +30,5 @@ file_env() { file_env "RABBITMQ_PASS" file_env "TAIGA_SECRET_KEY" -echo "Listing all env vars"; printenv /taiga-events/docker/entrypoint.sh diff --git a/entrypoint-nginx.sh.tmpl b/entrypoint-nginx.sh.tmpl new file mode 100644 index 0000000..4359a38 --- /dev/null +++ b/entrypoint-nginx.sh.tmpl @@ -0,0 +1,19 @@ +#!/bin/sh +set -e + +wait() { + host="$1" + port="$2" + name="$3" + + echo "Waiting for $name ($host:$port)..." + while ! nc -z "$host" "$port"; do + sleep 1 + done + echo "$name is up" +} +wait taiga-front 80 "taiga-front" +wait taiga-back 8000 "taiga-back" + +echo "Starting nginx" +exec nginx -g "daemon off;"