nigma / heroku-centrifuge

Python Centrifuge deployment on Heroku

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

heroku-centrifuge

This is a simple recipe for deploying Python Centrifuge on Heroku PaaS.

Centrifuge is an Open Source real-time messaging backend similar to Pusher, Pubnub or Faye.

The end result will look like centrifuge.herokuapp.com (admin password: password).

Create Heroku app

Clone this repository or copy files to a new git repo and provision a new Heroku app.

heroku apps:create app-name

Provision Heroku services

Start with provisioning dev service plans:

heroku addons:add rediscloud:25
heroku addons:add heroku-postgresql:hobby-dev

Promote created Postgres Database to default db:

heroku pg:promote HEROKU_POSTGRESQL_*_URL

Enable websockets support:

heroku labs:enable websockets

Configure centrifuge

Update Procfile and specify Redis connection settings or use --base option for single-instance deployment.

You can look up RedisCloud host, port and password (skip username) using heroku config command.

Do the same for centrifuge.json and amend the file:

{
    "password": "password",
    "cookie_secret": "secret",
    "api_secret": "secret",
    "structure": {
        "storage": "centrifuge.structure.postgresql.Storage",
        "update_interval": 60,
        "settings": {
            "url": "$DATABASE_URL"
        }
    },
    "state": {
        "storage": "centrifuge.state.redis.State",
        "settings": {
            "host": "<redis host>",
            "port": <redis port>,
            "password": "<redis password>"
        }
    }
}

Deploy to Heroku

git push heroku master
heroku logs --tail

Navigate to admin panel

Go to app-name.herokuapp.com and configure project settings as described in centrifuge.readthedocs.org

License

django-herokuify is released into the Public Domain.

Contribute

Contribute to Centrifuge at github.com/FZambia/centrifuge.

Open pull requests to send updates for the heroku-centrifuge recipe.

About

Python Centrifuge deployment on Heroku

License:Other