nginx container waits for taiga-front and taiga-back startup
This commit is contained in:
3
abra.sh
3
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
|
||||
export PG_BACKUP_VERSION=v1
|
||||
export NGINX_ENTRYPOINT_VERSION=v1
|
||||
14
compose.yml
14
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
|
||||
|
||||
@ -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
19
entrypoint-nginx.sh.tmpl
Normal 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;"
|
||||
Reference in New Issue
Block a user