Skip to content

Setup without Docker

Kai Stewart edited this page Feb 12, 2018 · 7 revisions

Instructions for using the Action Center without Docker are archived here. These instructions are not actively maintained.

Environment-specific Configuration

Secrets should be loaded into Rails application using environment variables. When running the Action Center in Docker, environment variables are set in docker-compose.yml.

To run the Action Center without Docker, set the environment variables using the included dotenv gem:

  1. Create a file called .env in the root directory of the project.
  2. Copy the environment variables from the docker-compose.yml.example file. The environment variables are marked by ## Start of application environment variables and ## End of application environment variables.
  3. Replace colons with equal signs, ex. storage = s3.
  4. Fill in the environment variables.

Local Setup

Install system package dependencies (the below example works on Ubuntu/precise). You need postresql 9.3 at least.

# On Ubuntu/precise:
$  sudo apt-get install postgresql postgresql-contrib-9.3 libpq-dev libqt4-dev libqtwebkit-dev nodejs

# On OSX:
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # Skip this step if you have Homebrew
$ brew install postgresql; initdb /usr/local/var/postgres -E utf8
$ brew install postgis; brew install [email protected]; echo 'export PATH="$(brew --prefix [email protected])/bin:$PATH"' >> ~/.bashrc; brew install node
# start postgres: details at https://www.postgresql.org/docs/9.4/static/app-pg-ctl.html
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

For convenience, you may configure a postgresql superuser, and then run the below commands to bring the app online.

$  sudo -u postgres bash -c "psql -c \"CREATE ROLE actioncenter PASSWORD 'CHANGEMEinproduction6f799ae4eb3d59e' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN; \""

$  ruby -v
   gem install bundler # skip this if you have bundler
   bundle install
   rake db:create
   rake db:schema:load
   rails server

Once the server is running, navigate to localhost:3000/register and create yourself a user account. You will need to provide (and confirm) a valid email in order to log in. When that's done, promote yourself to be an admin using the following command:

rake users:add_admin[[email protected]]

Now you should be able to go to localhost:3000/admin/action_pages to create your first action page.

Heroku Setup

First create a new app and configure it with a Postgres add on. Then

git remote add heroku [email protected]:your-action-center-app.git
git push heroku master
heroku run rake db:migrate

As with above, you can now register a user account and confirm your email.

heroku run rake users:add_admin[[email protected]]

Production Setup

Follow these instructions https://www.digitalocean.com/community/articles/how-to-install-rails-and-nginx-with-passenger-on-ubuntu

Clone this wiki locally