8

I have create a docker image on my dev machine and tested my RAILS code on it. The container uses code from the host this way :

docker run -v [/path/to/dir/to/mount/on/local/machine/]:[/desired/path/in/docker/] -p [port to forward] -i -t [name of image] /bin/bash

Now I would like to push the container to a preproduct environment and then a production environment.

What is the best way to do that ? Should I install docker on the preprod/prod servers and then use the image ?

Or should I configure my staging to be identitical to my image and upload my source code ?

user2854544
  • 851
  • 1
  • 11
  • 23
  • Can you give some details about what is actually in the volume specified by `-v`? Is it some source code, some assets, something else? – jpetazzo Oct 08 '13 at 18:52
  • are you sure you want to go to production with docker, they say it's not ready for that yet. – Marcelo A Nov 06 '13 at 19:07

1 Answers1

2

Are you deploying a rails app? I would take a look at Dokku which is basically a self hosted version of heroku.

If you want to use docker directly I would take a look at using a deployment script of some type to help you with this. Basically it can login via ssh, git clone the code to a directory and then run the docker image with the new directory (stopping any existing instances). But again Dokku makes this way simpler.

Austin Lin
  • 2,545
  • 17
  • 17