Skip to content

Latest commit

 

History

History
83 lines (53 loc) · 1.94 KB

LEARNING.md

File metadata and controls

83 lines (53 loc) · 1.94 KB

Table of Contents

Dockerfile & Docker Compose

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

Docker Compose Explained

Running your server in Production

  1. For running your app in prod you can use AWS , GCP , AZURE. For this I used DigitalOcean but you choose anyone of these CSP's.

  2. 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.

  1. Open your CMD prompt & type
ssh root@<ip_address>

Note : This is ip address of your droplet.

  1. Install docker and docker 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
  1. 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.