- Overview of Docker and FastAPI
- Why use Docker and FastAPI? Benefits in development and deployment.
- Docker Installation
- Ensure Docker Desktop is Running (Important Note)
- Basic Docker Commands
docker --help,docker run --help,docker ps --help- Top 10 Important Docker Commands:
docker rundocker psdocker tagdocker imagesdocker pulldocker pushdocker builddocker execdocker stopdocker rm
- Creating a Dockerfile
- Explanation of key instructions (FROM, RUN, CMD, etc.)
- Introduction to Docker Compose
- Top 10 Important Docker Compose Commands:
docker-compose updocker-compose downdocker-compose builddocker-compose psdocker-compose logsdocker-compose execdocker-compose stopdocker-compose rmdocker-compose restartdocker-compose scale
- Top 10 Important Docker Compose Commands:
- Scaling with Docker Compose
- Example: Scaling up with
--scale(multiple instances with different ports)
- Example: Scaling up with
- Nginx as a Reverse Proxy
- Basic setup of Nginx for load balancing and reverse proxy.
- Pushing to Docker Hub
- Docker Credentials Setup
docker login(enter username and password)
- Tagging and Pushing Images
docker tag hello-world laxmimerit/hello-world:latestdocker push laxmimerit/hello-world:latest
- Docker Credentials Setup
- Saving and Loading Docker Images
- Save image to a tar/zip file:
docker save -o hello-world.tar laxmimerit/hello-world:latest - Load image from tar/zip file:
docker load -i hello-world.tar
- Save image to a tar/zip file:
- Adding and running ML code inside Docker containers.
- Pushing to AWS
- Push to AWS S3 Bucket (optional)
- Push to AWS ECR (Elastic Container Registry)
- Deploying on AWS
- Deploying to AWS ECS (Elastic Container Service)
- Deploying to AWS EC2 (Elastic Compute Cloud)
- Build a FastAPI application, containerize it, and deploy it using Docker and AWS.
-
sudo apt-get remove docker docker-engine docker.io containerd runc
-
sudo apt-get update
-
sudo apt-get install docker.io
-
sudo systemctl start docker
-
sudo systemctl enable docker
-
sudo usermod -aG docker $USER
-
sudo systemctl status docker