A simple full‑stack project demonstrating how to build a Flask web application backed by a PostgreSQL database, with pgAdmin included for database management.
The stack runs entirely in Docker containers, making it easy to start, stop, and reset.
The goal of this repository is to provide a minimal but complete example of:
- Running a Python Flask app in Docker
- Persisting data in a PostgreSQL database
- Managing the database visually with pgAdmin
- Using environment variables (
.env) to keep secrets out of source code - Demonstrating a clean development workflow with Docker Compose
git clone https://github.com/<your-username>/people-database.git
cd people-database- create folder
db_dataas this is where database content will be saved (assuming windows)
POSTGRES_USER=myuser
POSTGRES_PASSWORD=supersecret
POSTGRES_DB=mydb
PGADMIN_DEFAULT_EMAIL=admin@admin.com
PGADMIN_DEFAULT_PASSWORD=adminsecretthis file is ignored by Git (see .gitignore)
docker-compose up --buildThis will start three services:
- web → Flask app (http://localhost:5000)
- db → PostgreSQL database (port 5432)
- pgadmin → pgAdmin web UI (http://localhost:8080)
Access the Flask app
- Open http://localhost:5000
- The app connects to the Postgres database and displays data from the people table. Manage the database with pgAdmin
- Go to http://localhost:8080
- Log in with the credentials from .env (PGADMIN_DEFAULT_EMAIL / PGADMIN_DEFAULT_PASSWORD)
Here’s what the app looks like running locally:
