-
Notifications
You must be signed in to change notification settings - Fork 1
Heroku
The Smoke Signals project maintains a heroku
branch suitable for deployment to heroku.com. The heroku
branch is designed to run on on Heroku's free tier, using only one web dyno. This page contains more information about using this branch on Heroku or in another environment.
To deploy to Heroku you need to:
-
Install the Heroku toolbelt
-
Create a new app on Heroku (referred to as
your_app
):heroku create yourapp
-
Add the Heroku Postgres :: Jade add-on:
heroku addons:add heroku-postgresql:dev
-
Create database tables:
heroku pg:psql < db/schema.sql
-
Set the environment variables, replacing the FLASK_SECRET with your own value and SMOKESIGNALS_URL with the url for your heroku app:
heroku config:set FLASK_SECRET="YOUR SECRET VALUE", SMOKESIGNALS_URL="http://yourapp.herokuapp.com"
-
Get your database's URL by running
heroku config | grep POSTGRESQL
and set DATABASE_URL to the same value:heroku config:set DATABASE_URL=url_from_last_command
-
Push to Heroku:
git push heroku heroku:master
-
Fire up a dyno:
heroku ps:scale web=1
-
And you're done! You can see your app with:
heroku open
If you want to use the heroku branch to deploy to your own server, here is the set up you'll need to do:
# Install dependencies
pip install -r requirements.txt
gem install foreman
# Set up database
initdb db/smokesignals.db
pg_ctl -D db/smokesignals.db/ start
createdb smokesignals
psql smokesignals < db/schema.sql
# Set environment variables
export FLASK_SECRET="YOUR SECRET HERE"
export SMOKESIGNALS_URL="http://localhost:5000"
export DATABASE_URL="postgres://localhost/smokesignals"
# Start server
foreman start