mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-26 17:26:05 +02:00
update
This commit is contained in:
@@ -102,5 +102,5 @@ services:
|
|||||||
slug: grampsweb
|
slug: grampsweb
|
||||||
tmpfs: true
|
tmpfs: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/grampsweb
|
url: https://github.com/alexbelgium/hassio-addons/tree/master/grampsweb
|
||||||
version: "0.1"
|
version: "0.2"
|
||||||
webui: "[PROTO:ssl]://[HOST]:[PORT:80]"
|
webui: "[PROTO:ssl]://[HOST]:[PORT:80]"
|
||||||
|
|||||||
@@ -22,6 +22,20 @@ if [ -d /root/.gramps/grampsdb ] && [ "$(ls -A /root/.gramps/grampsdb)" ]; then
|
|||||||
ln -sf /config/grampsdb /root/.gramps/grampsdb
|
ln -sf /config/grampsdb /root/.gramps/grampsdb
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#####################
|
||||||
|
# Create secret key #
|
||||||
|
#####################
|
||||||
|
if [ ! -s /config/secret/secret ]
|
||||||
|
then
|
||||||
|
mkdir -p /config/secret
|
||||||
|
python3 -c "import secrets;print(secrets.token_urlsafe(32))" | tr -d "\n" > /config/secret/secret
|
||||||
|
fi
|
||||||
|
# use the secret key if none is set (will be overridden by config file if present)
|
||||||
|
if [ -z "$SECRET_KEY" ]
|
||||||
|
then
|
||||||
|
export SECRET_KEY=$(cat /config/secret/secret)
|
||||||
|
fi
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# Starting Redis #
|
# Starting Redis #
|
||||||
##################
|
##################
|
||||||
@@ -29,11 +43,19 @@ echo "Starting Redis..."
|
|||||||
redis-server &
|
redis-server &
|
||||||
REDIS_PID=$!
|
REDIS_PID=$!
|
||||||
|
|
||||||
|
###############
|
||||||
|
# Starting App #
|
||||||
|
###############
|
||||||
|
echo "Starting Gramps Web App..."
|
||||||
|
/docker-entrypoint.sh gunicorn -w ${GUNICORN_NUM_WORKERS:-8} -b 0.0.0.0:5000 gramps_webapi.wsgi:app --timeout ${GUNICORN_TIMEOUT:-120} --limit-request-line 8190 &
|
||||||
|
APP_PID=$!
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# Starting Celery #
|
# Starting Celery #
|
||||||
##################
|
##################
|
||||||
|
bashio::net.wait_for 5000 localhost 900
|
||||||
echo "Starting Celery..."
|
echo "Starting Celery..."
|
||||||
celery -A gramps_webapi.celery worker --loglevel=INFO --concurrency=2 &
|
celery -A gramps_webapi worker --loglevel=INFO --concurrency=2 &
|
||||||
CELERY_PID=$!
|
CELERY_PID=$!
|
||||||
|
|
||||||
#################
|
#################
|
||||||
@@ -43,12 +65,5 @@ echo "Starting nginx..."
|
|||||||
exec nginx & bashio::log.info "Starting nginx"
|
exec nginx & bashio::log.info "Starting nginx"
|
||||||
NGINX_PID=$!
|
NGINX_PID=$!
|
||||||
|
|
||||||
###############
|
|
||||||
# Starting App #
|
|
||||||
###############
|
|
||||||
echo "Starting Gramps Web App..."
|
|
||||||
/docker-entrypoint.sh gunicorn -w ${GUNICORN_NUM_WORKERS:-8} -b 0.0.0.0:5000 gramps_webapi.wsgi:app --timeout ${GUNICORN_TIMEOUT:-120} --limit-request-line 8190 &
|
|
||||||
APP_PID=$!
|
|
||||||
|
|
||||||
# Wait for all background processes
|
# Wait for all background processes
|
||||||
wait $REDIS_PID $CELERY_PID $APP_PID $NGINX_PID
|
wait $REDIS_PID $CELERY_PID $APP_PID $NGINX_PID
|
||||||
|
|||||||
Reference in New Issue
Block a user