2023-09-21 17:50:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2023-11-27 11:06:22 +01:00
|
|
|
./bin/migrate-check
|
|
|
|
|
2023-09-21 17:50:19 +02:00
|
|
|
# To ensure we are able to expose metrics from multiple processes, we need to
|
|
|
|
# provide a directory for `prometheus_client` to store a shared registry.
|
|
|
|
export PROMETHEUS_MULTIPROC_DIR=$(mktemp -d)
|
|
|
|
chmod -R 777 $PROMETHEUS_MULTIPROC_DIR
|
|
|
|
trap 'rm -rf "$PROMETHEUS_MULTIPROC_DIR"' EXIT
|
|
|
|
|
|
|
|
export PROMETHEUS_METRICS_EXPORT_PORT=8001
|
|
|
|
export STATSD_PORT=${STATSD_PORT:-8125}
|
2024-04-18 11:13:06 +02:00
|
|
|
export NGINX_UNIT_PYTHON_PROTOCOL=${NGINX_UNIT_PYTHON_PROTOCOL:-wsgi}
|
2024-05-29 13:01:09 +02:00
|
|
|
export NGINX_UNIT_APP_PROCESSES=${NGINX_UNIT_APP_PROCESSES:-4}
|
2024-04-18 11:13:06 +02:00
|
|
|
envsubst < /docker-entrypoint.d/unit.json.tpl > /docker-entrypoint.d/unit.json
|
|
|
|
|
2023-09-21 17:50:19 +02:00
|
|
|
|
2023-11-07 16:12:03 +01:00
|
|
|
# We need to run as --user root so that nginx unit can proxy the control socket for stats
|
|
|
|
# However each application is run as "nobody"
|
|
|
|
exec /usr/local/bin/docker-entrypoint.sh unitd --no-daemon --user root
|