0

I have a node.js application which depends on phantom.js. Since both node and phantom.js are not exactly a breeze to set up, I created a Docker container which does this. Now how do I deploy updates of my application to this docker container running on our production server.

For me, there are two possibilities.

  1. Set up SSH and push my git repository directly into the Docker container
  2. Add a volume and update the repository outside the container

I tend to the latter, but I'm not sure there is a better way.

Thanks in advance!

1
  • Alternatively, you might consider putting the application in the image, and simply rebuilding a new image when updating the code. Commented Oct 22, 2014 at 12:22

1 Answer 1

1

both ways would allow you to update your application in an existing container.

However what happens if you delete your container?

  • in the second way you can recreate a brand new container linked to the same volume that holds your app
  • in the first way you would have to also connect to ssh and upload the app code

Moreover the Dockerfile will be more complicated in the first case and more difficult to maintain. You will also have to take care of security issues and make sure the whole world won't be able to connect to the ssh server.


To sum up, make it KISS and go the volume way. Only consider adding a ssh service if you need it for more than just pushing files.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for your input, I will do it the second way.
Okay, but I need to compile binaries with npm and since this should be done on the machine itself, neither of both make sense. I thought about a private docker registry. But then I have no chance of automatically building it (maybe Jenkins?)
since docker 1.3 you can execute a command on a running docker (see the docker exec command) ; you could use that to your advantage to recompile your binaries in a running docker container anytime you see fit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.