This application demonstrates a complete web stack using Docker Compose with a Python Flask backend, Nginx reverse proxy with SSL, and PostgreSQL database with sample user data.
This project creates a fully functional web application with:
- Python Flask web server displaying user data in a tabular format
- PostgreSQL database with sample user records
- Nginx reverse proxy with self-signed SSL certificate
- w2ui JavaScript library for table rendering
- All components orchestrated via Docker Compose
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Nginx (443) │ │ Flask (5000) │ │ PostgreSQL │
│ Reverse │───▶│ Web App │───▶│ Database │
│ Proxy │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ │ │
└───────────────────────┼───────────────────────┘
│
┌─────────────────┐
│ Client Browser │
└─────────────────┘
This setup demonstrates a complete deployment architecture for:
- Developing web applications with containerized components
- SSL termination with Nginx
- Database-backed web applications
- Frontend rendering with JavaScript libraries
- Development environments that mirror production
-
Flask Web Application:
- Displays user table using w2ui JavaScript library
- Connects to PostgreSQL database
- Renders data in a responsive table format
-
PostgreSQL Database:
- Pre-populated with sample user data
- Schema with users table containing id, name, and email fields
-
Nginx Reverse Proxy:
- HTTPS termination with self-signed certificate
- SSL certificate can be easily swapped out
- Reverse proxy to Flask application
- HTTP to HTTPS redirect
-
Docker Compose:
- All components orchestrated together
- Easy deployment and scaling
- Volume mounts for configuration and data persistence
- Make sure Docker and Docker Compose are installed
- Run
docker-compose up -dto start all services - Access the application at
https://localhost - For development, you can modify files in the local directory and they will be reflected in containers
The Nginx service uses a self-signed certificate located at certs/server.crt and certs/server.key. You can easily swap these out with your own certificate files:
- Place your certificate files in the
certsdirectory - Update
nginx.confif necessary - Restart the Nginx container with
docker-compose restart nginx
The Flask application is configured to run with debugging enabled for development purposes. All files are mounted as volumes for easy development iteration.
This entire solution was generated using offline agentic coding capabilities. No cloud services were involved in the development process, demonstrating secure, local AI-assisted software development.