Docker Rails + Nginx + Unicorn (from Ubuntu 16.04 & Ruby 2.4.0)
Docker Rails + Nginx + Unicorn (from Ubuntu 16.04 & Ruby 2.4.0). Easy useable docker for rails. less configuration, affordable production.
Dockerfile
to your project and paste below code.# Dockerfile
FROM zeroc0d3/docker-rails-nginx-unicorn
MAINTAINER ZeroC0D3 Team ([email protected])
EXPOSE 80
unicorn
gem (add/uncomment gem 'unicorn'
in Gemfile
)# build your dockerfile
$ docker build -t your/project .
# run container
$ docker run -d -p 80:80 -e SECRET_KEY_BASE=secretkey your/project
if your rails app required pre-install lib like imagemagick (or others) use rails-nginx-unicorn-pro
# 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
Change FROM
instruction your Dockerfile
# Dockerfile
FROM zeroc0d3/docker-rails-nginx-unicorn:ruby2.4.0-nginx1.10.3
...