HUB
Sign inSign up

gabeos/docker-flask-template

By gabeos

•Updated over 11 years ago

Image
0

453

gabeos/docker-flask-template repository overview

⁠Flask Template in Docker

⁠Note on Branches

It's worth noting that there are currently two branches here. One (master) with Bootstrap 3 as the CSS framework, the other with the more minimal Skeleton CSS. I'm not sure that everything works well in the demo app on the skeleton branch, but it's there if you want the install with Skeleton to hack away on.

⁠What is this?

A fully configured and ready to hack flask template loaded up with Bootstrap 3, jQuery, and a bunch of Flask Extensions, served via nginx and uWSGI.

All credit for the actual Flask app implementation and design goes to Steven Loria (@sloria) and his project cookiecutter-flask. This Dockerfile basically just wraps that up into a container, removes some unnecessaries and replaces gunicorn with uWSGI.

Head over to cookiecutter-flask⁠ to learn more about the contained app.

⁠Docs

⁠Database

Use linked postgres or mysql/mariadb container for automated db configuration. See fig.yml in repo for example.

Otherwise use DB_URI or DB_*. DB_URI takes precedence:

⁠Environment Variables

SectionVariable NameDefaultDetails
Flask
CREATE_FLASK_DBtrueAutomatically create database tables for app. Won't overwrite your DB when container is restarted based on presence of /var/www/flask/.bootstrap
User Info
PROJECT_NAMEFlask TemplateName you would like to show up in the templates
USER_EMAIL[email protected]⁠Email to provide in the contact link (mailto:$USER_EMAIL)
Server
SERVER_NAME'_'Nginx 'server_name' directive.
Mail
MAIL_SERVERSMTP server
MAIL_PORT587Port
MAIL_TLStrueUse TLS for communication with mail server
MAIL_SSLfalseUse SSL for communication with mail server
MAIL_USERadminLogin username for SMTP server
MAIL_PASSLogin password for SMTP server
MAIL_SENDER[email protected]⁠Email address to send mail from
DB
DB_URISpecify whole URI in one environment variable
DB_USERLogin user for DB
DB_PASSPassword for user@db
DB_ADDRdomain or IP of DB
DB_PORTPort of DB
DB_TYPEType of database, 'mysql' or 'postgresql'. Optional if DB port is standard mysql (3306) or postgres (5432) port

Tag summary

Content type

Image

Digest

sha256:6bb987065…

Size

204.7 MB

Last updated

over 11 years ago

docker pull gabeos/docker-flask-template