Notes taken by Abd @ITNA Digital

Links

🔗 Link to the video

Keywords

Docker Compose

Table of Contents


Why we need Docker Compose

Previously we have run a -

Instead of having all this messy configuration we can build a YAML file that describes all the configuration and connects the two databases with on network.

Docker Compose allows putting configuration of multiple containers in to one file. Instead of writing all that messy commands we will just create everything in one fell sweep with Docker Compose. Docker Compose is a convenient way to run multiple related services with just one config file.

Run docker-compose if you have installed docker desktop. If not follow the instructions on how to install it.

configing docker compose

Create the file "docker-compose.yaml".

docker-compose.yaml

services:
  pgdatabase:
    image: postgres:13
    environment:
      - POSTGRES_USER=root
      - POSTGRES_PASSWORD=root
      - POSTGRES_DB=ny_taxi
    volumes:
      - "./ny_taxi_postgres_data:/var/lib/postgresql/data:rw"
    ports:
      - "5432:5432"
  pgadmin:
    image: dpage/pgadmin4
    environment:
      - [email protected]
      - PGADMIN_DEFAULT_PASSWORD=root
    ports:
      - "8080:80"

Untitled