nginx container waits for taiga-front and taiga-back startup

This commit is contained in:
a
2026-01-20 18:09:03 -08:00
parent ae370c2d57
commit d6914e09fe
4 changed files with 35 additions and 2 deletions

View File

@ -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
export PG_BACKUP_VERSION=v1
export NGINX_ENTRYPOINT_VERSION=v1

View File

@ -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

View File

@ -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

19
entrypoint-nginx.sh.tmpl Normal file
View File

@ -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;"