Skip to content

binRick/maude-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Web Stack with Flask, Nginx, and PostgreSQL

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.

Overview

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

Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Nginx (443)   │    │   Flask (5000)  │    │  PostgreSQL     │
│   Reverse       │───▶│   Web App       │───▶│  Database       │
│   Proxy         │    │                 │    │                 │
└─────────────────┘    └─────────────────┘    └─────────────────┘
         │                       │                       │
         │                       │                       │
         └───────────────────────┼───────────────────────┘
                                 │
                         ┌─────────────────┐
                         │  Client Browser │
                         └─────────────────┘

Use Case

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

Features

  1. Flask Web Application:

    • Displays user table using w2ui JavaScript library
    • Connects to PostgreSQL database
    • Renders data in a responsive table format
  2. PostgreSQL Database:

    • Pre-populated with sample user data
    • Schema with users table containing id, name, and email fields
  3. 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
  4. Docker Compose:

    • All components orchestrated together
    • Easy deployment and scaling
    • Volume mounts for configuration and data persistence

Quick Start

  1. Make sure Docker and Docker Compose are installed
  2. Run docker-compose up -d to start all services
  3. Access the application at https://localhost
  4. For development, you can modify files in the local directory and they will be reflected in containers

Certificate Management

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:

  1. Place your certificate files in the certs directory
  2. Update nginx.conf if necessary
  3. Restart the Nginx container with docker-compose restart nginx

Development

The Flask application is configured to run with debugging enabled for development purposes. All files are mounted as volumes for easy development iteration.

Offline Agentic Coding

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.

About

Docker web stack demo — Python Flask backend, Nginx reverse proxy with self-signed SSL, PostgreSQL with sample data, w2ui for table rendering.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors