Commit cf0d22dd authored by BAIRE Anthony's avatar BAIRE Anthony

fix the nginx config

- install django statics into /var/www at image build time
- django now on port 8000 (django's default) instead of 4000
- rename @allgo as @Django in nginx's config to decrease confusion
- publish port 8080 in docker-compose
parent b1130481
upstream allgo
upstream django
{
server 127.0.0.1:4000 fail_timeout=0;
# server unix:/run/rails.sock fail_timeout=0;
server 127.0.0.1:8000 fail_timeout=0;
}
server
......@@ -16,10 +15,10 @@ server
send_timeout 300s;
keepalive_timeout 5;
root /opt/allgo/public/;
try_files $uri/index.html $uri.html $uri @allgo;
root /var/www/html;
try_files $uri/index.html $uri.html $uri @django;
location @allgo
location @django
{
# the 'Host' header must be forwarded as-is because turbolinks needs it to
# work properly
......@@ -29,6 +28,6 @@ server
# proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_pass http://allgo;
proxy_pass http://django;
}
}
......@@ -27,3 +27,5 @@ rm /etc/nginx/sites-enabled/default
ln -s "$PWD/$path" "/$path"
done)
# install django static files into /var/www
(cd /opt/allgo && ALLGO_SECRET_KEY_PATH=/tmp/dummy_key python3 manage.py collectstatic --no-input -l -v0)
......@@ -22,6 +22,7 @@ services:
user: "$DOCKERUSER"
ports:
- "8008:8000"
- "8080:8080"
#command: "python3 manage.py runserver 0.0.0.0:8000"
volumes:
- "/data/dev/django:/vol"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment