Skip to content

Commit

Permalink
feat: Update dependencies for Django and add new packages; modify Ren…
Browse files Browse the repository at this point in the history
…der configuration for improved build and deployment
  • Loading branch information
AhmedNassar7 committed Dec 16, 2024
1 parent 4ac0133 commit 2deda45
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ coverage.xml
*.coveragerc

# Docker files (if applicable)
docker/
docker-compose.yml
Dockerfile
*.dockerignore
Expand Down
193 changes: 177 additions & 16 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package-mode = false # Disable packaging mode

[tool.poetry.dependencies]
python = "^3.9"
django = "^3.2"
fastapi = "^0.68.1"
uvicorn = "^0.15.0"
pydantic = "^1.8.2"
Expand All @@ -19,6 +20,9 @@ starlette = "^0.14.2"
asyncpg = "^0.30.0"
gunicorn = "^23.0.0"
pywin32 = { version = "306", optional = true, markers = "sys_platform == 'win32'" }
docker = "^7.1.0"
jinja2 = "^3.1.4"
python-dotenv = "^1.0.1"

[tool.poetry.dev-dependencies]
pytest = "^6.2.4"
Expand Down
29 changes: 14 additions & 15 deletions render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,31 @@
services:
- type: web
name: egypt-metro
env: python
dockerfilePath: ./docker/Dockerfile
runtime: python
region: frankfurt # Adjust based on your location
rootDirectory: backend # Root directory of the project
plan: free
buildCommand:
- apt-get update && apt-get install -y gcc libpq-dev python3-dev
- pip install --upgrade pip
- pip install -r requirements.txt
- python manage.py collectstatic --noinput
- python manage.py migrate --noinput
startCommand: "gunicorn egypt_metro.wsgi:application --bind 0.0.0.0:8000"
buildCommand: >
apt-get update && apt-get install -y gcc libpq-dev python3-dev &&
pip install --upgrade pip &&
pip install poetry &&
poetry install --no-dev &&
python manage.py collectstatic --noinput &&
python manage.py migrate --noinput
startCommand: "gunicorn egypt_metro.wsgi:application --bind 0.0.0.0:8000 --workers=3 --threads=2 --timeout=120"
envVars:
- key: ENVIRONMENT # Environment for loading specific config
value: prod
- key: SECRET_KEY
value: ${SECRET_KEY}
- key: DATABASE_URL
value: ${DATABASE_URL}
- key: CORS_ALLOW_ALL_ORIGINS # Set CORS settings
value: "True"
- key: ALLOWED_HOSTS
value: https://backend-54v5.onrender.com
- key: DEBUG
value: "False"
disk: # Persistent storage (optional)
name: persistent-data
mountPath: /var/lib/egypt-metro
sizeGB: 1
logging:
- path: /var/log/egypt-metro.log
secretFiles:
- path: /etc/secrets/env.prod # Load sensitive secrets (e.g., SECRET_KEY, JWT_SECRET)
healthCheckPath: "/health" # Optional, ensure health endpoint exists
Loading

0 comments on commit 2deda45

Please sign in to comment.