How to deploy an application using Docker

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.

  • Docker webpack dev server
  • How to restrict environment variables passed to linked containers
  • Installing openssh-server, g++, gdb, and gdbserver in a docker container | Visual C++ for Linux Development + Docker
  • HTTP status: 500 error on docker pull using docker-machine
  • How to have bash script answer interactive prompts (no y/n only)?
  • ImportError: cannot import name <package> in pods while restarting pod fixes
    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!

  • Failed to run service inside docker container
  • Docker for Windows 10 //./pipe/docker_engine: access is denied
  • Sending SIGTERM to all processes
  • Failed to connect to port 443: Connection refused, Failed to Bootstrap, Discourse Docker
  • How to pass arguments within docker-compose?
  • Spring can't connect to docker selenium container to run capybara via rspec
  • One Solution collect form web for “How to deploy an application using Docker”

    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.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.