docker compose up
Docker Compose is a tool used to define and run multi-container Docker applications using a simple YAML file docker-compose.yml It lets you start, stop, and manage multiple containers (like app + database + cache) with a single command (docker compose up), making development and deployment easier. version: "3.8" services: flask-app: build: . #path to dockerfile #to use existing image use image tag like in db and give path to image. ports: - "5000:5000" environment: - MYSQL_HOST=db - MYSQL_USER=root - MYSQL_PASSWORD=rootpassword - MYSQL_DB=flaskdb depends_on: - db networks: - app-network db: image: mysql:8.0 restart: always environment: - MYSQL_ROOT_PASSWORD=rootpassword - MYSQL_DATABASE=flaskdb volumes: - mysql-data:/var/lib/mysql networks: - app-network volumes: mysql-data: networks: app-network: driver: bridge 1. Healthchecks A way to tell its status beyond just ‘is it running’ ...