I had to perform these steps to deploy my Nodejs/Angular site to AWS via DockerCloud
- Write Dockerfile
- Build Docker Images base on my Dockerfiles
- Push those images to Docker Hub
- Create Node Cluster on DockerCloud Account
- Write Docker stack file on DockerCloud
- Run the stack on DockerCloud
- See the instance running in AWS, and can see my site
If we require a small thing changes that require a pull from my project repo. BUT we already deployed our dockers as you may know.
What is the best way pull those changes into the Docker containers that already deployed ?
I hope we don’t have to :
- Rebuild our Docker Images
- Re-push those images to Docker Hub
- Re-create our Node Cluster on DockerCloud
- Re-write our docker stack file on DockerCloud
- Re-run the stack on DockerCloud
I was thinking
SSH into a VM that has the Docker running
git pull
npm start
Am I on the right track?
If you want to treat a Docker container as a VM, you totally can, however, I would strongly caution against this. Anything in a container is ephemeral...if you make changes to files in it and the container goes down, it will not come back up with the changes.
That said, if you have access to the server you can exec into the container and execute whatever commands you want. Usually helpful for dev, but applicable to any container.
This command will start an interactive bash session inside your desired container. See the docs for more info.
docker exec -it <container_name> bash
Best practice would probably be to update the docker image and redeploy it.