Skip to content

Commit ceddf9c

Browse files
committed
Comments for proddev changes
1 parent 73dc0a1 commit ceddf9c

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

backend/docker-compose.yaml

+4
Original file line numberDiff line numberDiff 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 [email protected]; /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 [email protected]; /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:

backend/nginx-proddev.conf

+5
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
1+
# Reverse proxy configuration for emulating what will actually be run in production as described in /k8s/main.ts
2+
13
events { }
24

35
http {
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;

backend/officehoursqueue/settings/proddev.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
# Django config based off of production config, but with minor changes to ensure it works on dev machines
2+
13
from officehoursqueue.settings.production import *
24

35
import officehoursqueue.settings.base as base
46

7+
# Turning debug logs shouldn't introduce major differences, but will help with debugging
58
DEBUG = True
69

10+
# No https on dev machines
711
SECURE_PROXY_SSL_HEADER = ()
812

13+
# Prevents request rejection on dev machines
914
ALLOWED_HOSTS = ["*"]
1015

16+
# Use local login instead of UPenn's
1117
PLATFORM_ACCOUNTS = base.PLATFORM_ACCOUNTS
1218

1319
# Allow http callback for DLA

0 commit comments

Comments
 (0)