Coder Social home page Coder Social logo

qa-rq-flask's Introduction

redis-demo

Dev Instructions

Run pipenv install --dev to install the env.
Run pipenv run pre-commit install to initialize the git hooks.
Run pipenv run pre-commit run --all-files if there are file that were committed before adding the git hooks.
Activate the shell with: pipenv shell
Lint with: pylint app/

Run the App in Dev

Start Redis for Dev

Get redis docker image: docker pull redis
Start redis: docker run -d -p 6379:6379 redis
Find container id: docker ps
Stop redis: docker kill <container id>

Redis Queue Management

Start the redis queue worker: rq worker
Empty all redis queues: rq empty --all

Flask App

Start the flask app on dev server: export FLASK_APP=app.main:app && flask run --reload
Start the flask app in production server: gunicorn app.main:app

Build and Run the App With Docker (Dev)

Run docker-compose -f docker-compose-dev.yml build to build the containers.
Run docker-compose -f docker-compose-dev.yml up to start the app.
Run docker-compose -f docker-compose-dev.yml up -d to start the app in detached mode.
Run docker-compose -f docker-compose-dev.yml to stop the app.

Build and Run the App With Docker (Prod)

Run docker-compose build to build the containers.
Run docker-compose up to start the app.
Run docker-compose up -d to start the app in detached mode.
Run docker-compose down to stop the app.

Deployment Instructions

Provision an Ubuntu instance (I've used Ubuntu 20.04 LTS) with suitable security settings.
SSH into the instance.
Run sudo apt update and sudo apt install git -y to install git if your image doesn't already have it.
Clone this repo and change into it.
Run sudo sh setup.sh to install and configure docker and docker-compose.
Exit and SSH into the instance again.
Run the commands in the above "Build and Run the App With Docker" with sudo.

qa-rq-flask's People

Contributors

edkrueger 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.