Docker

What is Docker?

Why Docker?

How Docker Works?

Docker Architecture

Docker Commands

in start.sh

touch Dockerfile content - FROM python:3.8 WORKDIR /app COPY . /app RUN pip install -r requirements.txt CMD ["python", "app.py"]
touch docker-compose.yml content - version: '3' services: web: build: . ports: - "5000:5000"
docker build -t myapp . # Build an image from the Dockerfile in the current directory and tag the image docker run -d -p 4000:80 myapp # Run the app, mapping your machine’s port 4000 to the container’s published port 80 using -p docker ps # List all running containers docker stop <hash> # Gracefully stop the specified container docker ps -a # List all containers, even those not running docker rm <hash> # Remove the specified container from this machine docker images # List all images on this machine docker rmi <image id> # Remove the specified image from this machine docker-compose up # Build the app and run the container docker-compose down # Stop the container

Conclusion