Setting up a free background service on Heroku


heroku apps:create janus-worker --stack cedar --remote worker
git push worker master
heroku scale web=0 worker=1 --app=janus-worker
heroku config:add `heroku config -s --app=face-dev | grep redis` --app=janus-worker

Useful commands

heroku logs --tail --app face-dev
eroku ps --app face-dev
heroku ps --app janus-worker

Rails App with Docker and Fig

This is the tutorial I followed:

Tried this tutorial which has a separate worker for sidekiq as well, but didn’t manage to get it working:

As I didn’t manage to get this running:

fig build
fig run web RAILS_ENV=production rake db:create (Only once)
fig run web RAILS_ENV=production rake db:migrate
fig run web rake assets:precompile
fig up -d

fig build needs to be called every time the Dockerfile or Gemfile is changed.

The app should be reachable under something like

You can get the IP address using ‘boot2docker ip’.

Get env variables
fig run web env

Wanna check out what is going on in your dockerized app?
fig run web rails c

Run all commands as root on Ubuntu.

sudo fig run web rails c

Logilfes kann man direkt lesen

tailf log/development.log

These are the used images

Upgrade Postgres 9.3 to 9.4 on Heroku

Follow this instructions:

Here is what I did

heroku addons:add heroku-postgresql:hobby-dev --version=9.4
heroku pg:info
heroku maintenance:on
heroku pg:promote HEROKU_POSTGRESQL_CHARCOAL_URL (Change CHARCOAL accordingly)
heroku maintenance:off

Rails Minitest with Capybara


group :test do
  gem 'minitest-rails-capybara'
  gem 'minitest-reporters'
  gem 'mocha'
  gem 'guard'
  gem 'guard-minitest'
  gem 'terminal-notifier'
  gem 'terminal-notifier-guard', '~> 1.6.1'

An example for a feature test

require "test_helper"

feature "Customer List" do
  scenario "shows a list of customers" do
    visit customers_path