From bf85f2580c4a2218913754983c0f3aebc987f298 Mon Sep 17 00:00:00 2001 From: Alexander Trost Date: Sun, 23 Feb 2020 01:38:14 +0100 Subject: [PATCH] fixed static file compress and nginx issue Signed-off-by: Alexander Trost --- entrypoint.sh | 12 ++++-------- includes/nginx/nginx.conf | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2770ec9..fcb914d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,12 +10,8 @@ cd /healthchecks || { echo "/healthchecks directory not found. Exit 1"; exit 1; export SECRET_KEY="${SECRET_KEY:-$(openssl rand -base64 32)}" appRun() { - databaseConfiguration - settingsConfiguration - - python3 /healthchecks/manage.py compress + python3 /healthchecks/manage.py compress --force yes yes | python3 /healthchecks/manage.py collectstatic - ln -s /healthchecks/static-collected/CACHE /healthchecks/static/CACHE echo "Correcting config file permissions ..." chmod 755 -f /healthchecks/hc/settings.py /healthchecks/hc/local_settings.py @@ -65,10 +61,10 @@ case "$1" in $1 else COMMAND="$1" - if [[ -n $(which "$COMMAND") ]] ; then - echo "=> Running command: $(which "$COMMAND") $*" + if command -v "$COMMAND"; then + echo "=> Running command: $(command -v "$COMMAND") $*" shift 1 - exec "$(which "$COMMAND")" "$@" + exec "$(command -v "$COMMAND")" "$@" else appHelp fi diff --git a/includes/nginx/nginx.conf b/includes/nginx/nginx.conf index 56a32f1..47a7808 100644 --- a/includes/nginx/nginx.conf +++ b/includes/nginx/nginx.conf @@ -16,7 +16,6 @@ http { sendfile on; upstream app_server { - # For a TCP configuration: server 127.0.0.1:8001 fail_timeout=0; } @@ -29,7 +28,7 @@ http { location /static { # path for static files - root /healthchecks; + alias /healthchecks/static-collected/; } location / {