Giter Site home page Giter Site logo

ppgg-queue-manager's Introduction

Docker implementation of SMS-based Queue Manager

This repo builds upon the code found here, providing a Dockerfile to easily deploy a basic Python queue-manager application. You can read the full blog post for details about how the Dockerfile is put together.

Getting started

Clone this repo:

git clone https://github.com/nexmo-community/docker-queue-manager.git
cd docker-queue-manager

Make sure Docker is running on your computer, then enter the following to build the Docker image:

docker build --tag queue-app .

Run locally

If you'd like to run locally, you'll first need to prepare a few environment variables. First, populate .env with your Nexmo information. The default DATABASE_URL is equal to sqlite:///queue.db, but you can specify another database if you'd like (for local testing it is enough to create a SQLite database in the container, but this database will not persist after the container is stopped). Then, enter the following in your terminal:

docker run -d -p 5000:5000 --env-file .env queue_app

To fully test, you will need to use ngrok to provide a publically accessible URL for your app. In another terminal window, type the following:

./ngrok HTTP 5000

Copy the HTTPS forwarding URL and paste into the "Inbound Webhook URL" field under the settings for your Nexmo number. It should look like this:

https://<your ngrok url>/webhooks/inbound-sms

Deploy to Heroku

Before you can deploy to Heroku, you'll need to make sure you have the Heroku CLI and that you are logged in. Once you've done that, create an application and a Postgres DB for your app:

heroku create <your application name>
heroku addons:create heroku-postgresql:hobby-dev -a <your application name>

Now you'll want to update your Heroku config variables with your Nexmo credentials:

Heroku configs variables

Then, login to the Heroku container registry and push and release your Docker image:

heroku container:login
heroku container:push web -a <your application name>
heroku container:release web -a <your application name>

As a last step, make sure you update your Nexmo number settings with your Heroku app's URL:

https://<your Heroku url>/webhooks/inbound-sms

ppgg-queue-manager's People

Watchers

James Cloos avatar Cristian F. Torres Collazo 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.