Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save miklund/e9754a246aed10ebb16a to your computer and use it in GitHub Desktop.
Save miklund/e9754a246aed10ebb16a to your computer and use it in GitHub Desktop.
2015-12-11 Deploying legacy Rails application on Raspberry Pi 2 with Docker
# Deploying legacy Rails application on Raspberry Pi 2 with Docker
# Mikael Lundin
# http://blog.mikaellundin.name/2015/12/11/deploying-legacy-rails-application-on-raspberry-pi-2-with-docker.html
# Create a container for replay
FROM ubuntu:14.04
MAINTAINER Mikael Lundin <[email protected]>
# Install prerequisites
RUN apt-get update && apt-get install -y ruby ruby-dev git make libxslt-dev libxml2-dev libpq-dev libmagickwand-dev build-essential nodejs imagemagick
# Install ruby bundler
RUN gem install bundler --no-ri --no-rdoc
# Clone project into /var/www
RUN git clone https://github.com/rubriks/r3pl4y.git /var/www
# Set current working directory
WORKDIR /var/www
# Install all the gems
RUN bundle install --gemfile=/var/www/Gemfile
# Precompile assets
RUN RAILS_ENV=production bundle exec rake assets:precompile
# Set envrionment variables
ENV DATABASE_URL postgres://postgres:<obfuscated>@postgres:5432/r3pl4y_production
ENV facebook_app_id <obfuscated>
ENV facebook_app_secret <obfuscated>
ENV s3_access_key_id <obfuscated>
ENV s3_secret_access_key <obfuscated>
ENV steam_app_secret <obfuscated>
ENV tumblr_api_key <obfuscated>
ENV twitter_consumer_key <obfuscated>
ENV twitter_consumer_secret <obfuscated>
# open port 3000 for http
EXPOSE 3000
# start the application
CMD ["/var/www/script/rails", "server", "-e production"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment