Creating the Deployment Environment

Now it’s time to build a Docker image for this app. The image will be similar to the one you created in Chapter 2, Creating a Deployment Environment, but it will need a few additional dependencies because JRuby won’t be packaged with the app as it was with Warbler. To start, create a Dockerfile in the root directory of the repo and add the following code to it.

 FROM heroku/jvm

This instructs Docker to use the same JVM base image you used with Warbler. Now you can provision the Docker container with a JRuby installation by adding this code:

 RUN mkdir -p /usr/lib/jruby
 ENV JRUBY_HOME /usr/lib/jruby
 RUN curl -s -L \ ...

Get Deploying with JRuby 9k now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.