Coder Social home page Coder Social logo

edusfc15 / flask-sql-docker-compose Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phillipyferreira/flask-sql-docker-compose

0.0 0.0 0.0 84 KB

Flask application development skeleton with docker-compose

Python 77.11% HTML 21.35% Dockerfile 1.53%

flask-sql-docker-compose's Introduction

flask-docker-compose

About

Docker-Flask is about Flask project organization and running it in a docker-compose containers. Application has a basic user model with authentication(passwords hashing), database migrations, administration interface, celery asynchronous tasks, manage script, debug toolbar, bootstrap starter templates.

Application scheme

Including the followings

Pre-Build

Usage

Pull images

  • docker-compose pull

Build an image

  • docker-compose build flaskapp

Start a cluster

To start applications with development environment:

  • docker-compose up -d

To start applications with production environment (first copy configuration file and edit it)

  • cp app/settings/prod.py.repl app/settings/prod.py
  • docker-compose --file docker-compose.prod.yml up -d

To initialize, create migration and upgrade your database:

  • docker exec -it dockerflask_flaskapp_1 bash -c "python manage.py create_db"

To run ipython debug flaskapp shell:

  • docker exec -it dockerflask_flaskapp_1 bash -c "python manage.py shell"

To create admin user:

  • docker exec -it dockerflask_flaskapp_1 bash -c "python manage.py create_user -a"

Migrations

To initialize migrations:

  • docker exec -it dockerflask_flaskapp_1 bash -c "python manage.py db init"

To create a migration:

  • docker exec -it dockerflask_flaskapp_1 bash -c "python manage.py db migrate"

To upgrade your database with migration:

  • docker exec -it dockerflask_flaskapp_1 bash -c "python manage.py db upgrade"

Stop and destroy a cluster

  • docker-compose stop && docker-compose rm -f

Logs and troubleshooting

To check standard logs:

  • docker-compose logs

Access the application containers shell:

  • docker exec -it dockerflask_flaskapp_1 bash

Running tests

  • docker exec -it dockerflask_flaskapp_1 bash -c "python manage.py runtests"

flask-sql-docker-compose's People

Contributors

ip0000h avatar edusfc15 avatar snyk-bot avatar bitdeli-chef avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.