Skip to content

Commit

Permalink
fixed static file compress and nginx issue
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <galexrt@googlemail.com>
  • Loading branch information
galexrt committed Feb 23, 2020
1 parent 3e76392 commit bf85f25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
12 changes: 4 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions includes/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ http {
sendfile on;

upstream app_server {
# For a TCP configuration:
server 127.0.0.1:8001 fail_timeout=0;
}

Expand All @@ -29,7 +28,7 @@ http {

location /static {
# path for static files
root /healthchecks;
alias /healthchecks/static-collected/;
}

location / {
Expand Down

0 comments on commit bf85f25

Please sign in to comment.