NginX docker not yet …

This commit is contained in:
Ruidy Nemausat 2020-01-01 20:42:44 +01:00
parent a8b1f2035e
commit 66c989ea97
4 changed files with 7 additions and 4 deletions

View file

@ -10,7 +10,7 @@ services:
web:
build: .
command: bash -c "python manage.py migrate && python manage.py loaddata villafleurie.json && gunicorn -w 4 villafleurie.wsgi -b 0.0.0.0:8000"
container_name: villafleurie
# container_name: villafleurie
volumes:
- .:/villafleurie
- static_files:/static_files
@ -29,3 +29,5 @@ services:
- 80:80
volumes:
- static_files:/static_files
depends_on:
- web

View file

@ -1,4 +1,4 @@
FROM nginx
FROM nginx:latest
RUN rm /etc/nginx/conf.d/default.conf

View file

@ -9,7 +9,7 @@ server {
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_pass http://web:8000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}

View file

@ -29,7 +29,7 @@ if os.environ.get('ENV') == 'PRODUCTION':
# STATICFILES_DIRS = (os.path.join(PROJECT_ROOT, 'static'),)
# os.makedirs(STATIC_TMP, exist_ok=True)
# os.makedirs(STATIC_ROOT, exist_ok=True)
STATIC_ROOT = "/static_files/"
STATIC_ROOT = "/static/"
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True
CONN_MAX_AGE = 500
@ -56,6 +56,7 @@ else:
# STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
ALLOWED_HOSTS = [
'0.0.0.0',
'127.0.0.1',
'localhost'
]