How mubashir251-tech/secure-flask-microservice works
This is a containerized Flask API backed by PostgreSQL. The principal workflow is an HTTP request to the API, which either returns application/health status or uses a PostgreSQL connection for readiness, version, and user queries. The repository also documents hardened container deployment, secret handling, persistent storage, and image-assurance practices. Runtime behavior is supported by the app excerpt; deployment and assurance links rely on README statements, since those configurations were not sampled.
Main entry points: app.py Flask API · podman-compose.yml Compose deployment · init.sql Users schema · Containerfile Container hardening
Components 14
API runtime
- Flask API
app/app.py - Status and health
app/app.py - Readiness endpoint
app/app.py - Database info endpoint
app/app.py - Users endpoint
app/app.py
Database
- PostgreSQL connection
app/app.py - PostgreSQL service
compose/podman-compose.yml - Users schema
database/init.sql - Persistent data volume
compose/podman-compose.yml
Secure deployment
- Credential loading
app/app.py - Compose deployment
compose/podman-compose.yml - Container hardening
container/Containerfile - Image assurance
README.md
Other components
- HTTP client
Connections 16
- HTTP client → Flask API: sends HTTP
README.md - Flask API → Status and health: routes status
app/app.py - Flask API → Readiness endpoint: routes readiness
app/app.py - Flask API → Database info endpoint: routes database info
app/app.py - Flask API → Users endpoint: routes users
app/app.py - Readiness endpoint → PostgreSQL connection: tests connection
app/app.py - Database info endpoint → PostgreSQL connection: queries version
app/app.py - Users endpoint → PostgreSQL connection: queries users
app/app.py - PostgreSQL connection → Credential loading: uses credentials
app/app.py - PostgreSQL connection → PostgreSQL service: connects to
README.md - PostgreSQL service → Users schema: initializes
README.md - PostgreSQL service → Persistent data volume: persists data
README.md - Compose deployment → PostgreSQL service: deploys service
README.md - Compose deployment → Flask API: deploys service
README.md - Compose deployment → Container hardening: runs hardened
README.md - Compose deployment → Image assurance: supports assurance
README.md