Skip to content

atulkamble/docker-flask-postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Docker Flask + PostgreSQL - Python Web App with Database

A containerized Flask application with PostgreSQL database demonstrating database integration.

πŸš€ Features

  • Flask web framework with PostgreSQL
  • Environment-based database configuration
  • Persistent PostgreSQL data
  • Health check endpoints
  • Production-ready setup

πŸ“ Project Structure

docker-flask-postgres/
β”œβ”€β”€ web/
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── app.py
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ k8s/
β”‚   β”œβ”€β”€ postgres-deployment.yaml
β”‚   β”œβ”€β”€ postgres-service.yaml
β”‚   β”œβ”€β”€ web-deployment.yaml
β”‚   └── web-service.yaml
└── README.md

πŸ› οΈ Quick Start

# Clone and run
git clone https://github.com/atulkamble/docker-flask-postgres.git
cd docker-flask-postgres
docker compose up -d

# Test the application
curl http://localhost:5001

πŸ§ͺ Testing

# Test database connection
curl http://localhost:5001/health

πŸ”§ Configuration

  • Web Port: 5001
  • Database: PostgreSQL 16
  • Environment Variables: PGHOST, PGUSER, PGPASSWORD, PGDATABASE

Docker Hub: atuljkamble/docker-flask-postgres-web
GitHub: atulkamble/docker-flask-postgres

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published