-
Notifications
You must be signed in to change notification settings - Fork 2
Add docker compose profile for emulating production #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5e7ccaf
eef77ef
29675ed
efac6a1
139113c
d2c6af6
098de44
1fcad61
40bf9e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,3 +15,4 @@ LICENSE | |
| **/__pycache__/ | ||
| tests/ | ||
| postgres/ | ||
| .venv | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Reverse proxy configuration for emulating what will actually be run in production as described in /k8s/main.ts | ||
|
|
||
| events { } | ||
|
|
||
| http { | ||
| server { | ||
| listen 80; | ||
|
|
||
| # Frontend is served unless overridden by other locations | ||
| location / { | ||
| proxy_pass http://proddev-frontend:3000; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| } | ||
|
|
||
| # The wsgi backend is used on routes starting with '/api', '/admin', or '/assets' | ||
| location ~ ^/(api|admin|assets) { | ||
| proxy_pass http://proddev-backend-wsgi:80; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| } | ||
|
|
||
| # The asgi backend is used for websocket requests on routes starting with '/api/ws' | ||
| location /api/ws { | ||
| proxy_pass http://proddev-backend-asgi:80; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
|
|
||
| # For web sockets | ||
| proxy_http_version 1.1; | ||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection "Upgrade"; | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Django config based off of production config, but with minor changes to ensure it works on dev machines | ||
|
|
||
| from officehoursqueue.settings.production import * | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whats the reason for adding this new
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a basis for the django settings for proddev. It is based off of the production settings, but with some changes so it still actually works in the development environment. For example, unless
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe it's possible to override Django settings with just environment variables without changing settings files. |
||
|
|
||
| import officehoursqueue.settings.base as base | ||
|
|
||
| # No https on dev machines | ||
| SECURE_PROXY_SSL_HEADER = () | ||
|
|
||
| # Prevents request rejection on dev machines | ||
| ALLOWED_HOSTS = ["*"] | ||
|
|
||
| # Use local login instead of UPenn's | ||
| PLATFORM_ACCOUNTS = base.PLATFORM_ACCOUNTS | ||
|
|
||
| # Allow http callback for DLA | ||
| os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "1" | ||
|
|
||
| # Use the console for email in development | ||
| EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,60 @@ | ||
| [project] | ||
| name = "" | ||
clay53 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| version = "0.0.1" | ||
| requires-python = "==3.11.4" | ||
| dependencies = [ | ||
| "dj-database-url==2.2.0", | ||
| "djangorestframework==3.15.2", | ||
| "psycopg2-binary==2.9.6", | ||
| "uvloop==0.17.0", | ||
| "sentry-sdk", | ||
| "django==5.0.3", | ||
| "django-cors-headers==4.4.0", | ||
| "pyyaml==6.0.2", | ||
| "uritemplate==4.1.1", | ||
| "uwsgi==2.0.27", | ||
| "django-labs-accounts==0.7.1", | ||
| "django-phonenumber-field[phonenumbers]==8.0.0", | ||
| "drf-nested-routers==0.94.1", | ||
| "django-email-tools==0.1.1", | ||
| "twilio==9.3.3", | ||
| "djangorestframework-camel-case==1.4.2", | ||
| "django-filter==24.3", | ||
| "celery==5.4.0", | ||
| "redis==5.1.1", | ||
| "django-auto-prefetching==0.2.12", | ||
| "django-rest-live==0.7.0", | ||
| "channels==3.0.5", | ||
| "channels-redis==4.2.0", | ||
| "uvicorn[standard]==0.31.0", | ||
| "gunicorn==23.0.0", | ||
| "django-schedules-ohq==0.10.1.4", | ||
| "typing-extensions==4.12.2", | ||
| "drf-excel==2.4.1", | ||
| "pytz==2024.2", | ||
| "inflection==0.5.1", | ||
| ] | ||
|
|
||
| [tool.black] | ||
| line-length = 100 | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "black==22.3.0", | ||
| "unittest-xml-reporting==3.2.0", | ||
| "flake8==7.1.1", | ||
| "flake8-absolute-import==1.0.0.2", | ||
| "flake8-isort==6.1.1", | ||
| "flake8-quotes==3.4.0", | ||
| "django-debug-toolbar==4.4.6", | ||
| "django-extensions==3.2.3", | ||
| "parameterized==0.9.0", | ||
| "tblib==3.0.0", | ||
| ] | ||
|
|
||
| [tool.uv] | ||
| package = false | ||
|
|
||
| [[tool.uv.index]] | ||
| name = "pypi" | ||
| url = "https://pypi.org/simple" | ||
Uh oh!
There was an error while loading. Please reload this page.