The Dockerfile
is essentially the build instructions to build the image.
Docker Compose is a tool that helps us overcome this problem and easily handle multiple containers at once.
For more details head over to official documentation
- Dockerfile
- Docker-Compose & also can checkout my blog here
-
For running your app in
prod
you can use AWS , GCP , AZURE. For this I usedDigitalOcean
but you choose anyone of these CSP's. -
Next step is to create a new project.
Head over to create a new Droplet for your project.
Choose your options ,for this I used following settings
- Ubuntu (20.04 LTS x64)
- Basic
- CPU options
- Premium Intel with NVMe SSD ($6/month)
- Choose the nearest datacenter
Select your project and you are all done , hit the CREATE
It would take some time to spin the droplet.
- Open your CMD prompt & type
ssh root@<ip_address>
Note : This is ip address of your droplet.
- Install
docker
anddocker compose
on your Droplet
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo apt-get install docker-compose-plugin
- Clone your project from
github
git clone <repo_url>
& run
make docker-compose_prod
You are all done ✔️!!
Note : Make sure never do build in prod
as it may take more resource utilization & make sure to delete the droplet when you done.