mirror of
https://github.com/rjNemo/villafleurie
synced 2026-06-06 02:16:47 +00:00
NginX docker not yet …
This commit is contained in:
parent
a8b1f2035e
commit
66c989ea97
4 changed files with 7 additions and 4 deletions
|
|
@ -10,7 +10,7 @@ services:
|
||||||
web:
|
web:
|
||||||
build: .
|
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"
|
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:
|
volumes:
|
||||||
- .:/villafleurie
|
- .:/villafleurie
|
||||||
- static_files:/static_files
|
- static_files:/static_files
|
||||||
|
|
@ -29,3 +29,5 @@ services:
|
||||||
- 80:80
|
- 80:80
|
||||||
volumes:
|
volumes:
|
||||||
- static_files:/static_files
|
- static_files:/static_files
|
||||||
|
depends_on:
|
||||||
|
- web
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM nginx
|
FROM nginx:latest
|
||||||
|
|
||||||
RUN rm /etc/nginx/conf.d/default.conf
|
RUN rm /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ server {
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
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 X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ if os.environ.get('ENV') == 'PRODUCTION':
|
||||||
# STATICFILES_DIRS = (os.path.join(PROJECT_ROOT, 'static'),)
|
# STATICFILES_DIRS = (os.path.join(PROJECT_ROOT, 'static'),)
|
||||||
# os.makedirs(STATIC_TMP, exist_ok=True)
|
# os.makedirs(STATIC_TMP, exist_ok=True)
|
||||||
# os.makedirs(STATIC_ROOT, exist_ok=True)
|
# os.makedirs(STATIC_ROOT, exist_ok=True)
|
||||||
STATIC_ROOT = "/static_files/"
|
STATIC_ROOT = "/static/"
|
||||||
CSRF_COOKIE_SECURE = True
|
CSRF_COOKIE_SECURE = True
|
||||||
SESSION_COOKIE_SECURE = True
|
SESSION_COOKIE_SECURE = True
|
||||||
CONN_MAX_AGE = 500
|
CONN_MAX_AGE = 500
|
||||||
|
|
@ -56,6 +56,7 @@ else:
|
||||||
# STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
|
# STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
|
||||||
|
|
||||||
ALLOWED_HOSTS = [
|
ALLOWED_HOSTS = [
|
||||||
|
'0.0.0.0',
|
||||||
'127.0.0.1',
|
'127.0.0.1',
|
||||||
'localhost'
|
'localhost'
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue