mirror of
https://github.com/aykhans/series-robot-web.git
synced 2025-04-20 14:01:25 +00:00
Removed gunicorn and fixed nginx
This commit is contained in:
parent
46bbb10d20
commit
a689929478
@ -1,19 +1,19 @@
|
|||||||
upstream restgunicorn_server{
|
upstream django_server{
|
||||||
server django:8000;
|
server django:8000;
|
||||||
}
|
}
|
||||||
|
|
||||||
server{
|
server{
|
||||||
listen 8080;
|
listen 8080;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://restgunicorn_server;
|
proxy_pass http://django_server;
|
||||||
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;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /django_static/ {
|
location /django_static/ {
|
||||||
alias /src/django_static/;
|
alias /django_static/;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,17 +5,20 @@ services:
|
|||||||
image: postgres
|
image: postgres
|
||||||
volumes:
|
volumes:
|
||||||
- dbdata:/var/lib/postgresql/data
|
- dbdata:/var/lib/postgresql/data
|
||||||
- static_volume:/src/django_static
|
|
||||||
env_file:
|
env_file:
|
||||||
- config/db/databasepostgresql_env
|
- config/db/databasepostgresql_env
|
||||||
|
|
||||||
django:
|
django:
|
||||||
|
environment:
|
||||||
|
- DJANGO_SETTINGS_MODULE=config.settings.production
|
||||||
build: .
|
build: .
|
||||||
command: gunicorn src.config.wsgi:application --bind 0.0.0.0:8000
|
command: python3 src/manage.py runserver 0.0.0.0:8000 --settings=config.settings.production
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
volumes:
|
||||||
|
- static_volume:/django_static
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx
|
image: nginx
|
||||||
@ -23,7 +26,7 @@ services:
|
|||||||
- "1337:8080"
|
- "1337:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- ./config/nginx/local.conf:/etc/nginx/conf.d/default.conf:ro
|
- ./config/nginx/local.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
- static_volume:/src/django_static
|
- static_volume:/django_static
|
||||||
depends_on:
|
depends_on:
|
||||||
- django
|
- django
|
||||||
|
|
||||||
|
@ -17,9 +17,7 @@ DATABASES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
STATIC_URL = '/django_static/'
|
STATIC_URL = '/django_static/'
|
||||||
STATIC_ROOT = [
|
STATIC_ROOT = os.path.join(os.path.dirname(os.path.dirname(BASE_DIR)), 'django_static')
|
||||||
BASE_DIR / 'django_static'
|
|
||||||
]
|
|
||||||
STATICFILES_DIRS = [
|
STATICFILES_DIRS = [
|
||||||
BASE_DIR / 'django_static/static'
|
BASE_DIR / 'static'
|
||||||
]
|
]
|
@ -2,6 +2,6 @@ import os
|
|||||||
|
|
||||||
from django.core.wsgi import get_wsgi_application
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.production')
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
||||||
|
|
||||||
application = get_wsgi_application()
|
application = get_wsgi_application()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user