Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

navinnahar/Python_Flask_PostgreSQL_DB_Docker

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask on Docker with external PostgreSQL database

A simple Python Flask application running in a Docker container and connecting via SQLAlchemy to a PostgreSQL database.

The database connection information is specified via environment variables DBHOST, DBPASS, DBUSER, and DBNAME. This app always uses the default PostgreSQL port.

There are two releases of this app. Version 0.1-initialapp demonstrates a complete app, whereas version 0.2-migration introduces model changes and a database migration.

Download one of the releases then build and run in Docker locally via:

docker build -t docker-flask-sample .
docker run -it --env DBPASS="<PASSWORD>" --env DBHOST="<SERVER_HOST_NAME>" --env DBUSER="<USERNAME>" --env DBNAME="<DATABASE_NAME>" -p 5000:5000 docker-flask-sample`

The app can be reached in your browser at http://127.0.0.1:5000.

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.