-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Refactor settings for environment variables, add health check e…
…ndpoint, and update logging configuration; include render.yaml for deployment
- Loading branch information
1 parent
e806406
commit baaa9c4
Showing
6 changed files
with
70 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
MIT License | ||
# MIT License | ||
|
||
Copyright (c) 2024 Egypt Metro | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from django.http import JsonResponse | ||
|
||
def health_check(request): | ||
return JsonResponse({"status": "ok"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
services: | ||
- type: web | ||
name: egypt-metro | ||
env: python | ||
region: cairo # Adjust based on your location | ||
buildCommand: "pip install -r requirements.txt" | ||
startCommand: "gunicorn egypt_metro.wsgi:application --bind 0.0.0.0:8000" | ||
envVars: | ||
- key: ENVIRONMENT # Environment for loading specific config | ||
value: prod | ||
- key: DATABASE_URL # Add the database URL environment variable | ||
value: postgres://postgres:123@localhost:5432/egypt_metro | ||
- fromGroup: egypt-metro-env-group # Link generic variables from environment group | ||
- key: CORS_ALLOW_ALL_ORIGINS # Set CORS settings | ||
value: "True" | ||
disk: # Persistent storage (optional) | ||
name: persistent-data | ||
mountPath: /var/lib/egypt-metro | ||
sizeGB: 1 | ||
secretFiles: | ||
- path: /etc/secrets/env.prod # Load sensitive secrets (e.g., SECRET_KEY, JWT_SECRET) | ||
healthCheckPath: "/health" # Optional, ensure health endpoint exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters