-
Notifications
You must be signed in to change notification settings - Fork 0
Deploy Containers
Dmytro Somliev edited this page Apr 11, 2022
·
14 revisions
- Bind Mounts shouldn't be used in Production. Use COPY instead. No volumes as well. Code should not be changed on prod!!!
- In some cases you may need build process (React app)
- Multi-Containers Project may be split between different hosts
Simple (one container)
- Prepare all image locally and then deploy it into remote machine is more practical choice. You can deploy all your code on remote machine, but it's brings too many unnecessary movements.
- Create a new repo in Docker Hub.
- Build image locally with the tag=your_repo_name.
- Push you image into Hub by
docker push. - Run published image under your host terminal with the same commands as you do on your local machine.
- Configure security group on your host machine to expose all required ports.
- After code changed, rebuild image, tag it and push to Docker Hub. Then pull new image from your host and run it.
Disadvantages:
Fully responsible by developer: All software must be updated properly. Manage network and security group/ firewall. SSH connection to make a deploy.
Each cloud provider has it's own services that support automation deployment process, but each of the has it's own rules.
Multiple containers
- Build each image separately based on your needs.
- Push image to Docker Hub.
- Add all pushed images into host cluster.
- Tasks used to bind together containers on remote host.