File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
officehoursqueue/settings Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ services:
1515 image : redis:4.0
1616 ports :
1717 - " 6379:6379"
18+ # api, dashboard, and admin requests for proddev
1819 proddev-backend-wsgi :
1920 depends_on :
2021 - db
@@ -30,6 +31,7 @@ services:
3031 - DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
3132 - DJANGO_SETTINGS_MODULE=officehoursqueue.settings.proddev
3233 command : sh -c "python manage.py migrate && { DJANGO_SUPERUSER_PASSWORD=root python manage.py createsuperuser --no-input --username root --email root@pennlabs.org; /usr/local/bin/django-run; }"
34+ # Web socket requests for proddev
3335 proddev-backend-asgi :
3436 depends_on :
3537 - db
@@ -45,6 +47,7 @@ services:
4547 - DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
4648 - DJANGO_SETTINGS_MODULE=officehoursqueue.settings.proddev
4749 command : sh -c "python manage.py migrate && { DJANGO_SUPERUSER_PASSWORD=root python manage.py createsuperuser --no-input --username root --email root@pennlabs.org; /usr/local/bin/asgi-run; }"
50+ # frontend for proddev
4851 proddev-frontend :
4952 profiles :
5053 - proddev
@@ -53,6 +56,7 @@ services:
5356 dockerfile : ../frontend/Dockerfile
5457 ports :
5558 - " 8003:80"
59+ # Reverse proxy for routing requests to the various proddev servers based on the path
5660 nginx :
5761 image : nginx:latest
5862 depends_on :
Original file line number Diff line number Diff line change 1+ # Reverse proxy configuration for emulating what will actually be run in production as described in /k8s/main.ts
2+
13events { }
24
35http {
46 server {
57 listen 80;
68
9+ # Frontend is served unless overridden by other locations
710 location / {
811 proxy_pass http://proddev-frontend:3000;
912 proxy_set_header Host $host;
1013 proxy_set_header X-Real-IP $remote_addr;
1114 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
1215 }
1316
17+ # The wsgi backend is used on routes starting with '/api', '/admin', or '/assets'
1418 location ~ ^/(api|admin|assets) {
1519 proxy_pass http://proddev-backend-wsgi:80;
1620 proxy_set_header Host $host;
1721 proxy_set_header X-Real-IP $remote_addr;
1822 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
1923 }
2024
25+ # The asgi backend is used for websocket requests on routes starting with '/api/ws'
2126 location /api/ws {
2227 proxy_pass http://proddev-backend-asgi:80;
2328 proxy_set_header Host $host;
Original file line number Diff line number Diff line change 1+ # Django config based off of production config, but with minor changes to ensure it works on dev machines
2+
13from officehoursqueue .settings .production import *
24
35import officehoursqueue .settings .base as base
46
7+ # Turning debug logs shouldn't introduce major differences, but will help with debugging
58DEBUG = True
69
10+ # No https on dev machines
711SECURE_PROXY_SSL_HEADER = ()
812
13+ # Prevents request rejection on dev machines
914ALLOWED_HOSTS = ["*" ]
1015
16+ # Use local login instead of UPenn's
1117PLATFORM_ACCOUNTS = base .PLATFORM_ACCOUNTS
1218
1319# Allow http callback for DLA
You can’t perform that action at this time.
0 commit comments