File tree 3 files changed +15
-0
lines changed
officehoursqueue/settings
3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ services:
15
15
image : redis:4.0
16
16
ports :
17
17
- " 6379:6379"
18
+ # api, dashboard, and admin requests for proddev
18
19
proddev-backend-wsgi :
19
20
depends_on :
20
21
- db
@@ -30,6 +31,7 @@ services:
30
31
- DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
31
32
- DJANGO_SETTINGS_MODULE=officehoursqueue.settings.proddev
32
33
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
33
35
proddev-backend-asgi :
34
36
depends_on :
35
37
- db
@@ -45,6 +47,7 @@ services:
45
47
- DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
46
48
- DJANGO_SETTINGS_MODULE=officehoursqueue.settings.proddev
47
49
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
48
51
proddev-frontend :
49
52
profiles :
50
53
- proddev
@@ -53,6 +56,7 @@ services:
53
56
dockerfile : ../frontend/Dockerfile
54
57
ports :
55
58
- " 8003:80"
59
+ # Reverse proxy for routing requests to the various proddev servers based on the path
56
60
nginx :
57
61
image : nginx:latest
58
62
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
+
1
3
events { }
2
4
3
5
http {
4
6
server {
5
7
listen 80;
6
8
9
+ # Frontend is served unless overridden by other locations
7
10
location / {
8
11
proxy_pass http://proddev-frontend:3000;
9
12
proxy_set_header Host $host;
10
13
proxy_set_header X-Real-IP $remote_addr;
11
14
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
12
15
}
13
16
17
+ # The wsgi backend is used on routes starting with '/api', '/admin', or '/assets'
14
18
location ~ ^/(api|admin|assets) {
15
19
proxy_pass http://proddev-backend-wsgi:80;
16
20
proxy_set_header Host $host;
17
21
proxy_set_header X-Real-IP $remote_addr;
18
22
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
19
23
}
20
24
25
+ # The asgi backend is used for websocket requests on routes starting with '/api/ws'
21
26
location /api/ws {
22
27
proxy_pass http://proddev-backend-asgi:80;
23
28
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
+
1
3
from officehoursqueue .settings .production import *
2
4
3
5
import officehoursqueue .settings .base as base
4
6
7
+ # Turning debug logs shouldn't introduce major differences, but will help with debugging
5
8
DEBUG = True
6
9
10
+ # No https on dev machines
7
11
SECURE_PROXY_SSL_HEADER = ()
8
12
13
+ # Prevents request rejection on dev machines
9
14
ALLOWED_HOSTS = ["*" ]
10
15
16
+ # Use local login instead of UPenn's
11
17
PLATFORM_ACCOUNTS = base .PLATFORM_ACCOUNTS
12
18
13
19
# Allow http callback for DLA
You can’t perform that action at this time.
0 commit comments