Production-ready Django REST Framework API containerized with Python 3.13-slim and PostgreSQL 16.
57
A fully containerized, high-performance RESTful API for the Little Lemon Restaurant management system, built with Django REST Framework and orchestrated with PostgreSQL 16.
python:3.13-slim for a minimal attack surface and small footprint (~97MB compressed).psycopg 3 for robust and high-speed PostgreSQL connectivity..env).postgres_data).To spin up the entire API stack along with the PostgreSQL database, create a docker-compose.yaml:
services:
web:
image: mahmoudaboelfotouh/little-lemon-api:v1.0
container_name: little_lemon_api
restart: always
ports:
- "8000:8000"
environment:
- DB_ENGINE=django.db.backends.postgresql
- DB_NAME=littlelemon_db
- DB_USER=lemon_user
- DB_PASSWORD=secretpassword
- DB_HOST=db
- DB_PORT=5432
depends_on:
- db
db:
image: postgres:16-alpine
container_name: little_lemon_postgres
restart: always
environment:
- POSTGRES_DB=littlelemon_db
- POSTGRES_USER=lemon_user
- POSTGRES_PASSWORD=secretpassword
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
volumes:
postgres_data:
docker compose up -d
docker compose exec web python manage.py migrate
Access the API at: http://localhost:8000/api/
| Layer | Technology |
|---|---|
| Language & Runtime | Python 3.13-slim |
| Web Framework | Django 5.x / Django REST Framework (DRF) |
| Database | PostgreSQL 16 |
| Package Manager | Pipenv |
| Containerization | Docker & Docker Compose |
Full project source code, database schemas, and API endpoints are available on GitHub: š GitHub: Little-Lemon-DRFā
Content type
Image
Digest
sha256:ef288b5edā¦
Size
97.6 MB
Last updated
30 days ago
docker pull mahmoudaboelfotouh/little-lemon-api:v1.0