From 6c13d4be8ce63b4ee8f94e67de6665c7e0bb8078 Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Sun, 15 Jan 2017 19:39:17 -0600 Subject: [PATCH] One day the docker stuff will work. --- bikeshop_project/bikeshop/settings/base.py | 2 +- docker/nginx/Dockerfile | 5 ++++- docker/nginx/conf/nginx-site.conf | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bikeshop_project/bikeshop/settings/base.py b/bikeshop_project/bikeshop/settings/base.py index 5887cf8..a7f19a7 100644 --- a/bikeshop_project/bikeshop/settings/base.py +++ b/bikeshop_project/bikeshop/settings/base.py @@ -126,7 +126,7 @@ STATICFILES_DIRS = [ ('vendor', os.path.join(BASE_DIR, 'vendor')), os.path.join(BASE_DIR, 'assets') ] - +STATIC_ROOT = 'STATIC' STATIC_URL = '/static/' AUTH_USER_MODEL = 'registration.CustomUser' diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile index e8c5ebb..15e23b8 100644 --- a/docker/nginx/Dockerfile +++ b/docker/nginx/Dockerfile @@ -1,2 +1,5 @@ -FROM nginx:alpine +FROM nginx +RUN echo 'deb http://ftp.debian.org/debian jessie-backports main' | tee /etc/apt/sources.list.d/backports.list +RUN apt-get update +RUN apt-get install -y python-certbot -t jessie-backports COPY conf/* /etc/nginx/conf.d/ diff --git a/docker/nginx/conf/nginx-site.conf b/docker/nginx/conf/nginx-site.conf index eb812db..95c369a 100644 --- a/docker/nginx/conf/nginx-site.conf +++ b/docker/nginx/conf/nginx-site.conf @@ -33,6 +33,10 @@ server { try_files $uri @proxy_to_app; } + location /static { + root /code/static; + } + location @proxy_to_app { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # enable this if and only if you use HTTPS