Dockerfiles for OpenShift 3 Rails deployments
dist contains ready-to-build dockerfiles.
- rails/pure An Apache/Passenger/Rails image
- rails/nodejs An Apache/Passenger/Rails/nodejs image
- rails/sphinx An Apache/Passenger/Rails/sphinx image
- rails/sphinx-transifex An Apache/Passenger/Rails/sphinx/transifex image
All these images are built on Dockerhub.
About the tags
ruby22, ruby24: stable versions, built from the
- dist/rails/pure/Dockerfile is built to puzzle/ose3-rails:ruby22*
- dist/rails/sphinx/Dockerfile (includes Sphinx 2.2) is built to puzzle/ose3-rails-sphinx:ruby22*
- dist/rails/sphinx/transifex/Dockerfile (includes Sphinx transifex client 0.12) is built to puzzle/ose3-rails-sphinx:ruby22*
- dist/rails/nodejs/Dockerfile (includes node) is built to puzzle/ose3-rails-nodejs:ruby22*
latest, devel: development versions, don't use in production
Change to the desired Dockerfiles' containing folder and
docker build .
spec section of your
source: type: "Git" git: uri: "<this repos' uri>" ref: "master" contextDir: "<e.g. dist/rails/pure>"
Dockerfiles and build contexts under
dist are generated from the source files at
Use ruby 2.3.1 (although everything > 2 should work), rvm will do so for you automatically.
rvm use 2.3.1 gem install bundler bundle install rake build
src contains ERB templates to build the Dockerfiles and the necessary files for their build contexts.
src ├── _build │ └── (The build script) └── rails (Collection of images) ├── _context (Contains files and folders to copy to build context) ├── _partials (Contains partials) ├── pure (An image) │ ├── Dockerfile.erb │ └── README.md.erb └── nodejs (Another image) ├── _context (nodejs specific build context contents)
dist/rails/nodejs/Dockerfileis generated from
The template has access to all partials in
nodejs/_partialsand all parent folders (
rails/_partialsin this case). A partial
_foo.erbis rendered by doing
<%= partial("foo") %>.
nodejs/_partials/_foo.erbwill take precedence over
- All necessary files for the docker build context (store them in the
_contextfolders) are copied to
dist/rails/nodejs/. A file