{"id":6047,"date":"2015-07-20T16:15:10","date_gmt":"2015-07-20T13:15:10","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=6047"},"modified":"2015-12-16T11:31:42","modified_gmt":"2015-12-16T09:31:42","slug":"running-rails-development-environment-docker","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/","title":{"rendered":"Running a Rails Development Environment in Docker"},"content":{"rendered":"<p>As we prepare our new Docker-based infrastructure for running your tests, we\u2019d like to show you how you can use the same environment for development as well. Feel free to follow along as I demonstrate how to move a simple Rails applications into Docker during development.<\/p>\n<p>Suppose we have a (very) simple new Rails application:<\/p>\n<pre class=\" brush:php\">gem install rails bundler\r\nrails new demo\r\ncd demo\r\nbundle install<\/pre>\n<p>Without any further configuration, this provides us with a Rails application, using SQLite as a database. And if we want to, we can run our tests and start the development server to take a look in our browser.<\/p>\n<pre class=\" brush:php\">bundle exec rake test\r\nbundle exec rails server<\/pre>\n<p>We can now access the default start page at <a href=\"http:\/\/localhost:3000\">localhost:3000<\/a>. It\u2019s not a very useful app, but it\u2019ll do for our purpose.<\/p>\n<p>Now, let\u2019s move this app to use in a Docker-based environment.<\/p>\n<h2>Step 1: Installing Docker<\/h2>\n<p>If you already have Docker up and running, you can skip this step and move on to <a href=\"#dockerizing\">Step 2, Dockerizing<\/a> right away. If not, let\u2019s get Docker running on your machine.<\/p>\n<p>At Codeship, we recommend using <a href=\"https:\/\/docs.docker.com\/machine\/\">Docker Machine<\/a>. It\u2019s a young project and still in beta, but we\u2019ve had great success using it internally.<\/p>\n<p>See their <a href=\"https:\/\/docs.docker.com\/machine\/#installation\">installation instructions<\/a> for how to get it running on your computer. Those instructions will include the necessary commands to get Docker itself running as well. Once you have Docker Machine installed, create a new environment (<em>e.g.<\/em>, based on <a href=\"https:\/\/www.virtualbox.org\/\">Virtualbox<\/a>) and configure your local host to use that environment for Docker.<\/p>\n<h2>Step 2: Dockerizing a Rails Application<\/h2>\n<p>Now that we have Docker installed and running, it\u2019s time to get our application running on it. Docker applications are configured via a <a href=\"https:\/\/docs.docker.com\/reference\/builder\/\">Dockerfile<\/a>, which defines how the container is built.<\/p>\n<p>The easiest Dockerfile includes a single line, the base image to use. The following one would, for example, provide an Ubuntu Trusty based system:<\/p>\n<pre class=\" brush:php\">FROM ubuntu:14.04<\/pre>\n<p>Many images are readily available, and you can search for a suitable base image at the <a href=\"https:\/\/registry.hub.docker.com\">Docker Hub<\/a>. We\u2019ll use the <strong>ruby:2.2<\/strong> base image.<\/p>\n<pre class=\" brush:php\">FROM ruby:2.2 \r\nMAINTAINER marko@codeship.com\r\n\r\n# Install apt based dependencies required to run Rails as \r\n# well as RubyGems. As the Ruby image itself is based on a \r\n# Debian image, we use apt-get to install those.\r\nRUN apt-get update &amp;&amp; apt-get install -y \\ \r\n  build-essential \\ \r\n  nodejs\r\n\r\n# Configure the main working directory. This is the base \r\n# directory used in any further RUN, COPY, and ENTRYPOINT \r\n# commands.\r\nRUN mkdir -p \/app \r\nWORKDIR \/app\r\n\r\n# Copy the Gemfile as well as the Gemfile.lock and install \r\n# the RubyGems. This is a separate step so the dependencies \r\n# will be cached unless changes to one of those two files \r\n# are made.\r\nCOPY Gemfile Gemfile.lock .\/ \r\nRUN gem install bundler &amp;&amp; bundle install --jobs 20 --retry 5\r\n\r\n# Copy the main application.\r\nCOPY . .\/\r\n\r\n# Expose port 3000 to the Docker host, so we can access it \r\n# from the outside.\r\nEXPOSE 3000\r\n\r\n# The main command to run when the container starts. Also \r\n# tell the Rails dev server to bind to all interfaces by \r\n# default.\r\nCMD [\"bundle\", \"exec\", \"rails\", \"server\", \"-b\", \"0.0.0.0\"]<\/pre>\n<p>After adding the above file as <strong>Dockerfile<\/strong> to your repository, we can now build the container and start running commands with it. We specify a tag via the <strong>-t<\/strong> option, so we can reference the container later on.<\/p>\n<pre class=\" brush:php\">docker build -t demo .\r\ndocker run -it demo \"bundle exec rake test\"\r\ndocker run -itP demo<\/pre>\n<p>Here are some explanations for the commands above:<\/p>\n<ul>\n<li><strong>docker run<\/strong> runs tasks in a Docker container. This is most commonly used for one-off tasks but is also very helpful in development.<\/li>\n<li>The <strong>-P<\/strong> option causes all ports defined in the Dockerfile to be exposed to unprivileged ports on the host and thus be accessible from the outside.<\/li>\n<li>If we don\u2019t specify a command to run on the command line, the command defined by the <strong>CMD<\/strong> setting will be run instead.<\/li>\n<\/ul>\n<p>We now have our Rails application running inside a Docker container, but how do we actually access it from our computer? We will use <strong>docker ps<\/strong>, a handy tool to list running Docker processes as well as additional information about them.<\/p>\n<pre class=\" brush:php\">$ docker ps\r\nCONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS                     NAMES\r\neb018d2ca6e2        demo           \"bundle exec 'rails    10 seconds ago      Up 9 seconds        0.0.0.0:32769-&gt;3000\/tcp   pensive_ritchie<\/pre>\n<p>We can see the container ID, the image it is based on, which command it is running, and the mapping of any exposed ports. With this information at hand, we can now open the app in our browser <a href=\"#\">http:\/\/localhost:32769<\/a>.<\/p>\n<blockquote><p>Note: If you don\u2019t have Docker running on your local machine, you need to replace <strong>localhost<\/strong> in the above URL with the IP address of the machine Docker is running on. If you\u2019re using Docker Machine, you can run <strong>docker-machine ip \u201c${DOCKER_MACHINE_NAME}\u201d<\/strong> to find out the IP.<\/p><\/blockquote>\n<p>The application is up and running and accessible from our development machine. But, each time we make a change, we need to build a new container. That\u2019s not very helpful. Let\u2019s improve our setup.<\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td>\n<a href=\"https:\/\/twitter.com\/share?text=%22Setting+up+a+Rails+dev+env+in+%40Docker+in+5+steps%22+via+%40codeship&amp;url=http:\/\/blog.codeship.com\/running-rails-development-environment-docker\/\" target=\"_blank\">\u201cSetting up a Rails dev env in @Docker in 5 steps\u201d via @codeship<\/a><\/p>\n<p><a href=\"https:\/\/twitter.com\/share?text=%22Setting+up+a+Rails+dev+env+in+%40Docker+in+5+steps%22+via+%40codeship&amp;url=http:\/\/blog.codeship.com\/running-rails-development-environment-docker\/\" target=\"_blank\">Click To Tweet<\/a>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Step 3: Docker Volumes<\/h2>\n<p>Docker supports what it calls <a href=\"https:\/\/docs.docker.com\/reference\/builder\/#volume\">volumes<\/a>. These are mount points which let you access data from either the native host or another container. In our case, we can mount our application folder into the container and don\u2019t need to build a new image for each change.<\/p>\n<p>Simply specify the local folder as well as where to mount it in the Docker container when calling <strong>docker run<\/strong>, and you\u2019re good to go!<\/p>\n<pre class=\" brush:php\">docker run -itP -v $(pwd):\/app demo<\/pre>\n<h2>Step 4: Improvements<\/h2>\n<p><a href=\"https:\/\/docs.docker.com\/articles\/dockerfile_best-practices\/\">Dockerfile Best Practices<\/a> lists some ways to improve performance and create easy to use Dockerfiles. One of those tips is using a <strong>.dockerignore<\/strong> file.<\/p>\n<h3>.dockerignore<\/h3>\n<p>Similar to a <strong>.gitignore<\/strong> file, <a href=\"https:\/\/docs.docker.com\/reference\/builder\/#dockerignore-file\">.dockerignore<\/a> lets us specify which files are excluded and not transferred to the container during the build. This is a great way to speed up the build times, by excluding files not needed in the container (<em>e.g.<\/em>, the <strong>.git<\/strong> subdirectory). Let\u2019s add the following <strong>.dockerignore<\/strong> file to our project<\/p>\n<pre class=\" brush:php\">.git*\r\ndb\/*.sqlite3\r\ndb\/*.sqlite3-journal\r\nlog\/*\r\ntmp\/*\r\nDockerfile\r\nREADME.rdoc<\/pre>\n<h3>Entrypoint<\/h3>\n<p>Because most of the commands we run on the Rails container will be prepended by <strong>bundle exec<\/strong>, we can define an [<strong>ENTRYPOINT<\/strong>] for all our commands. Simply change the Dockerfile like this:<\/p>\n<pre class=\" brush:php\"># Configure an entry point, so we don't need to specify \r\n# \"bundle exec\" for each of our commands.\r\nENTRYPOINT [\"bundle\", \"exec\"]\r\n\r\n# The main command to run when the container starts. Also \r\n# tell the Rails dev server to bind to all interfaces by \r\n# default.\r\nCMD [\"rails\", \"server\", \"-b\", \"0.0.0.0\"]<\/pre>\n<p>You can now run commands without specifying <strong>bundle exec<\/strong> on the console. If you need to, you can override the entrypoint as well.<\/p>\n<pre class=\" brush:php\">docker run -it demo \"rake test\"\r\ndocker run -it --entrypoint=\"\" demo \"ls -la\"<\/pre>\n<h3>Locales<\/h3>\n<p>If you\u2019re not happy with the default locale in your Docker container, you can switch to another one quite easily. Install the required package, regenerate the locales, and configure the environment variables.<\/p>\n<pre class=\" brush:php\">...\r\n\r\n# Install apt based dependencies required to run Rails as \r\n# well as RubyGems. As the Ruby image itself is based on a \r\n# Debian image, we use apt-get to install those.\r\nRUN apt-get update &amp;&amp; apt-get install -y \\ \r\n  build-essential \\ \r\n  locales \\ \r\n  nodejs\r\n\r\n# Use en_US.UTF-8 as our locale\r\nRUN locale-gen en_US.UTF-8 \r\nENV LANG en_US.UTF-8 \r\nENV LANGUAGE en_US:en \r\nENV LC_ALL en_US.UTF-8\r\n\r\n...<\/pre>\n<h2>Step 5: Moving your Development Environment to PostgreSQL<\/h2>\n<p>While SQLite might be fine for a simple app, you wouldn\u2019t use it in production. So let\u2019s move our development environment over to PostgreSQL instead.<\/p>\n<p>We could add the database to our container, but there\u2019s a better way to do this. Use <a href=\"https:\/\/docs.docker.com\/compose\/\">Docker Compose<\/a> to provision the database in a separate container and link those two together.<\/p>\n<p>To get <strong>Docker Compose<\/strong> installed, please follow the <a href=\"https:\/\/docs.docker.com\/compose\/install\/\">installation instructions<\/a> on their website.<\/p>\n<h3>Basic Compose Configuration<\/h3>\n<p>Once this is done, let\u2019s duplicate our configuration to work with Compose. Add a <strong>docker-compose.yml<\/strong> file to your repository and include the following configuration:<\/p>\n<pre class=\" brush:php\">app:\r\n  build: .\r\n  command: rails server -p 3000 -b '0.0.0.0'\r\n  volumes:\r\n    - .:\/app\r\n  ports:\r\n    - \"3000:3000\"<\/pre>\n<p>With the configuration above, running your development environment is as simple as running two commands:<\/p>\n<pre class=\" brush:php\">docker-compose build\r\ndocker-compose up<\/pre>\n<p>Even for a single container environment this has some (smaller) improvements over using <strong>docker<\/strong> directly. We can specify the <strong>VOLUME<\/strong> definition directly in the configuration file; we don\u2019t need to specify it on the command line. We can also define the port on the Docker host our application will be available at and don\u2019t need to look it up.<\/p>\n<h3>Adding PostgreSQL<\/h3>\n<p>We could now create a new Dockerfile for running PostgreSQL, but luckily we don\u2019t need to. There is a readily available <a href=\"https:\/\/registry.hub.docker.com\/_\/postgres\/\">PostgreSQL Docker image<\/a> available on the <a href=\"https:\/\/registry.hub.docker.com\">Docker Hub<\/a>, so let\u2019s just use that instead.<\/p>\n<pre class=\" brush:php\">app:\r\n  build: .\r\n  command: rails server -p 3000 -b '0.0.0.0'\r\n  volumes:\r\n    - .:\/app\r\n  ports:\r\n    - \"3000:3000\"\r\n  links:\r\n    - postgres\r\npostgres:\r\n  image: postgres:9.4\r\n  ports:\r\n    - \"5432\"<\/pre>\n<p>We defined a new container called <strong>postgres<\/strong>, based on the PostgreSQL 9.4 image (there are images for previous versions available as well), configured the port on the new image, and told our <strong>app<\/strong> container to define a link to the database.<\/p>\n<p>But how do we access the database from within our Rails application? Fortunately for us, Docker Compose exposes environment variables for linked containers, so let\u2019s take a look at those.<\/p>\n<pre class=\" brush:php\"># build new container images first\r\ndocker-compose build \r\ndocker-compose run -it app env<\/pre>\n<p>This will print a bunch of environment variables, including these two:<\/p>\n<pre class=\" brush:php\">...\r\nPOSTGRES_PORT_5432_TCP_ADDR=172.17.0.35\r\nPOSTGRES_PORT_5432_TCP_PORT=5432\r\n...<\/pre>\n<p>We can now use those in our <strong>database.yml<\/strong> to access the database server.<\/p>\n<pre class=\" brush:php\">default: &amp;default \r\n  adapter: postgresql \r\n  encoding: unicode \r\n  pool: 5 \r\n  timeout: 5000 \r\n  username: postgres \r\n  host: &lt;%= ENV['POSTGRES_PORT_5432_TCP_ADDR'] %&gt; \r\n  port: &lt;%= ENV['POSTGRES_PORT_5432_TCP_PORT'] %&gt;\r\n\r\ndevelopment: \r\n  &lt;&lt;: *default \r\n  database: app_development\r\n\r\n# Warning: The database defined as \"test\" will be erased and\r\n# re-generated from your development database when you run \"rake\".\r\n# Do not set this db to the same as development or production.\r\ntest: \r\n  &lt;&lt;: *default \r\n  database: app_test<\/pre>\n<p>We also need to change our <strong>Gemfile<\/strong> and remove the <strong>sqlite3<\/strong> gem and add <strong>pg<\/strong> instead.<\/p>\n<pre class=\" brush:php\"># Use postgresql as the database for Active Record.\r\ngem 'pg'<\/pre>\n<p>Having made those changes, let\u2019s rebuild our containers and configure the database.<\/p>\n<pre class=\" brush:php\">docker-compose build\r\ndocker-compose up\r\ndocker-compose run app rake db:create\r\ndocker-compose run app rake db:migrate<\/pre>\n<h2>Step 5.5: Extending Your Development Environment<\/h2>\n<p>With the steps shown above, it\u2019s easy to extend the development environment. Need a Redis server? Look for a <a href=\"https:\/\/registry.hub.docker.com\/_\/redis\/\">suitable image<\/a> on the Docker Hub, extend the <strong>docker-compose.yaml<\/strong> configuration file with a few lines, and restart your environment. The same goes for <a href=\"https:\/\/registry.hub.docker.com\/_\/memcached\/\">memcached<\/a> or other services you require.<\/p>\n<p>Want to test against a different Ruby version? Modify the <strong>Dockerfile<\/strong>, spin up the environment and run your tests.<\/p>\n<h2>Conclusion<\/h2>\n<p>Switching your development environment to Docker does take some amount of work, but the benefits are well worth it. You get an environment that\u2019s easy to share with fellow team members, you can model it to closely resemble your production environment, and extend it in a simple way. With Codeship\u2019s upcoming Docker infrastructure, you\u2019ll be able to use the same environment to run your tests on Codeship and then push the built and tested containers to your production servers and deploy them. Easy, fast, efficient, and with less room for errors.<\/p>\n<p>The best part is that it\u2019s easy to clean up once you\u2019re done with a project. You don\u2019t pollute your computer with all those different libraries you only need for that single project!<\/p>\n<h2>Extra Resources<\/h2>\n<ul>\n<li><a href=\"https:\/\/docs.docker.com\/articles\/dockerfile_best-practices\/\">Best Practices for Dockerfiles<\/a><\/li>\n<li><a href=\"https:\/\/docs.docker.com\/machine\/\">Documentation for Docker Machine<\/a><\/li>\n<li><a href=\"https:\/\/docs.docker.com\/compose\/\">Documentation for Docker Compose<\/a><\/li>\n<li><a href=\"https:\/\/blog.codeship.com\/continuous-integration-and-delivery-with-docker\/\">Continuous Integration and Delivery with Docker<\/a><\/li>\n<li><a href=\"http:\/\/beta.codeship.com\/\">Codeship Docker Infrastructure Beta<\/a><\/li>\n<\/ul>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/blog.codeship.com\/running-rails-development-environment-docker\/\">Running a Rails Development Environment in Docker<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/wcg\/\">WCG partner<\/a> Florian Motlik at the <a href=\"http:\/\/blog.codeship.com\/\">Codeship Blog<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>As we prepare our new Docker-based infrastructure for running your tests, we\u2019d like to show you how you can use the same environment for development as well. Feel free to follow along as I demonstrate how to move a simple Rails applications into Docker during development. Suppose we have a (very) simple new Rails application: &hellip;<\/p>\n","protected":false},"author":124,"featured_media":927,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[217,95],"class_list":["post-6047","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-docker","tag-rails"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Running a Rails Development Environment in Docker - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"As we prepare our new Docker-based infrastructure for running your tests, we\u2019d like to show you how you can use the same environment for development as\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Running a Rails Development Environment in Docker - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"As we prepare our new Docker-based infrastructure for running your tests, we\u2019d like to show you how you can use the same environment for development as\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-07-20T13:15:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-16T09:31:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Marko Locher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mlocher\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marko Locher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/\"},\"author\":{\"name\":\"Marko Locher\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/51ec90acf340809a14ccc580e2dd4f7d\"},\"headline\":\"Running a Rails Development Environment in Docker\",\"datePublished\":\"2015-07-20T13:15:10+00:00\",\"dateModified\":\"2015-12-16T09:31:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/\"},\"wordCount\":1483,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"keywords\":[\"Docker\",\"Rails\"],\"articleSection\":[\"Web Dev\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/\",\"name\":\"Running a Rails Development Environment in Docker - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"datePublished\":\"2015-07-20T13:15:10+00:00\",\"dateModified\":\"2015-12-16T09:31:42+00:00\",\"description\":\"As we prepare our new Docker-based infrastructure for running your tests, we\u2019d like to show you how you can use the same environment for development as\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Dev\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/web-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Running a Rails Development Environment in Docker\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/51ec90acf340809a14ccc580e2dd4f7d\",\"name\":\"Marko Locher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7b5b8997b6c3a93bad2229131f83460253e806f6f57cfd5b0c20cd71e6acf48e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7b5b8997b6c3a93bad2229131f83460253e806f6f57cfd5b0c20cd71e6acf48e?s=96&d=mm&r=g\",\"caption\":\"Marko Locher\"},\"description\":\"Support Deckhand at Codeship. Answering your questions, updating our documentation and generally making sure everybody is happy! In my spare time I like volleyball, sailing and skiing.\",\"sameAs\":[\"http:\/\/blog.codeship.com\/\",\"https:\/\/x.com\/mlocher\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/marko-locher\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Running a Rails Development Environment in Docker - Web Code Geeks - 2026","description":"As we prepare our new Docker-based infrastructure for running your tests, we\u2019d like to show you how you can use the same environment for development as","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/","og_locale":"en_US","og_type":"article","og_title":"Running a Rails Development Environment in Docker - Web Code Geeks - 2026","og_description":"As we prepare our new Docker-based infrastructure for running your tests, we\u2019d like to show you how you can use the same environment for development as","og_url":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2015-07-20T13:15:10+00:00","article_modified_time":"2015-12-16T09:31:42+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","type":"image\/jpeg"}],"author":"Marko Locher","twitter_card":"summary_large_image","twitter_creator":"@mlocher","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Marko Locher","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/"},"author":{"name":"Marko Locher","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/51ec90acf340809a14ccc580e2dd4f7d"},"headline":"Running a Rails Development Environment in Docker","datePublished":"2015-07-20T13:15:10+00:00","dateModified":"2015-12-16T09:31:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/"},"wordCount":1483,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","keywords":["Docker","Rails"],"articleSection":["Web Dev"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/","url":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/","name":"Running a Rails Development Environment in Docker - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","datePublished":"2015-07-20T13:15:10+00:00","dateModified":"2015-12-16T09:31:42+00:00","description":"As we prepare our new Docker-based infrastructure for running your tests, we\u2019d like to show you how you can use the same environment for development as","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/web-development\/running-rails-development-environment-docker\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Dev","item":"https:\/\/www.webcodegeeks.com\/category\/web-development\/"},{"@type":"ListItem","position":3,"name":"Running a Rails Development Environment in Docker"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/51ec90acf340809a14ccc580e2dd4f7d","name":"Marko Locher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7b5b8997b6c3a93bad2229131f83460253e806f6f57cfd5b0c20cd71e6acf48e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7b5b8997b6c3a93bad2229131f83460253e806f6f57cfd5b0c20cd71e6acf48e?s=96&d=mm&r=g","caption":"Marko Locher"},"description":"Support Deckhand at Codeship. Answering your questions, updating our documentation and generally making sure everybody is happy! In my spare time I like volleyball, sailing and skiing.","sameAs":["http:\/\/blog.codeship.com\/","https:\/\/x.com\/mlocher"],"url":"https:\/\/www.webcodegeeks.com\/author\/marko-locher\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/6047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/124"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=6047"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/6047\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/927"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=6047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=6047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=6047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}