Forked from https://github.com/seapy/dockerfiles/tree/master/rails-nginx-unicorn
Easy useable docker for rails. less configuration, affordable production.
- unicorn, nginx, foreman
- mysql, postgresql lib
- Create
Dockerfile
to your project and paste below code.
# Dockerfile
FROM iron/rails-nginx-unicorn
MAINTAINER iron.io
EXPOSE 80 443
To use ssl you will have to mount your SSL key/crt to /etc/nginx/ssl/server{crt,key}
NOTE: assets are precompiled at build time, not run time to save on start time. You should specify the RAILS_ENV you want to use in your Dockerfile as well.
# build your dockerfile
$ docker build -t your/project .
# run container
$ docker run -d -p 80:80 -e SECRET_KEY_BASE=secretkey your/project
# your Dockerfile
...
ADD config/your-custom-nginx.conf /etc/nginx/sites-enabled/default
...
place your unicorn config to config/unicorn.rb
place your Procfile to app root
TODO: automatically build different images here.
- github connection setting(like bitbucket)