Page cover

1.2.5 - Running Postgres and pgAdmin with Docker-Compose

Last updated Jan 20, 2025

Youtube Video | ~9 min

https://www.youtube.com/watch?v=hKI6PkPhpa0&list=PL3MmuxUbc_hJed7dXYoJw8DoCuVHhGEQb&index=9&pp=iAQB

โœ๏ธ This video is an introduction to docker-compose where we will learn how to configure postgres and pgadmin in a docker-compose yaml file. We will then learn how to run and close it down.

docker-compose comes with docker desktop on Mac & Windows. You can read more about docker compose here https://docs.docker.com/compose/

"Compose simplifies the control of your entire application stack, making it easy to manage services, networks, and volumes in a single, comprehensible YAML configuration file. Then, with a single command, you create and start all the services from your configuration file." - https://docs.docker.com/compose/. Now, we do not need to do the network steps we did in 1.2.3 to connect our two containers under a network, but instead can use a docker-compose YAML file.

๐Ÿ“ docker-compose.yaml

โ—ผ๏ธ Terminal runs the docker-compose.yaml and -d so we can still use our terminal

โ—ผ๏ธ Terminal stops the run

๐Ÿ‘€ Note that in the current docker compose, we now write compose.yaml files and run it using docker compose up -d so there is a space between the works instead of a dash -.

Resources

๐Ÿ“š Docker compose fundamentals

๐Ÿ“š Docker-compose Example

Last updated