Commit c92b8619 by Chif Gergő

Change staticfiles root, add frontend conf to nginx

With frontend deployment now works the portal, but it needs the frontend
to be deployed with the docker-compose file in the frontend repo.
Static files in /static/ conflicts with React build deployment.
parent 306c4cb9
Pipeline #1294 passed with stages
in 48 seconds
......@@ -6,6 +6,10 @@ upstream wsbackend {
server daphne-server:8001;
}
upstream frontend {
server frontend:80
}
server {
listen 80;
......@@ -40,8 +44,15 @@ server {
}
location /static/ {
alias /static/;
location /staticfiles/ {
alias /staticfiles/;
}
location / {
proxy_pass http://frontend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ services:
- "/static:/static"
networks:
- backend
restart: on-failure
depends_on:
- backend
......
......@@ -136,7 +136,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/2.1/howto/static-files/
STATIC_URL = "/static/"
STATIC_URL = "/staticfiles/"
###############################################################################
# RECIRCLE CONFIG
......
......@@ -14,7 +14,7 @@ DATABASES = {
}
}
STATIC_ROOT = "/static/"
STATIC_ROOT = "/staticfiles/"
CELERY_BROKER_URL = 'redis://redis:6379'
CELERY_RESULT_BACKEND = "redis://redis:6379"
......@@ -26,4 +26,4 @@ CHANNEL_LAYERS = {
"hosts": [(os.getenv('REDIS_HOST', 'redis'), 6379)],
},
},
}
\ No newline at end of file
}
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 sign in to comment