bundle install --system --without test development && PORT=3000 foreman start as the CMDIn the root of your Rails app, add a Dockerfile and a Procfile
Define your runtime processes in the Procfile:
web: bundle exec rackup -p $PORT
or something similar
In your Dockerfile:
RUN apt-get install -y libsqlite3-dev sqlite3 # <= change/add dependencies as appropriate
ADD . /var/application
WORKDIR /var/application
From $RAILS_ROOT:
docker build -t your_app_tag && docker run -p 3000:3000 -d your_app_tag
This will run bundle install and startup the application according to the Procfile. You should be able to curl it: curl $HOST:3000 | grep Getting
NOTE: if on OSX using boot2docker (which is what I do), $HOST in will need to reference the boot2docker instance; by default this is 192.168.59.103, not localhost.
Content type
Image
Digest
sha256:872fd6a9c…
Size
362.9 MB
Last updated
almost 11 years ago
docker pull adamstrickland/rails