Page cover

Docker-Compose Summary

Last updated Jan 22, 2025

✍️ To make sure I was understanding the final version of our Docker lesson, I did two things. I first worked through this quickstart https://docs.docker.com/compose/gettingstarted/ , which gave me another example of how to use docker-compose. I then went back and made sure I could use the docker-compose YAML file we created.

Thus, I *think* these are the steps we need to take if we were starting over:

1

What is our goal?

📝 From you code editor

First, write your code and figure out what your goal is. In our case we are writing a python script .py that ingests .csv data in postgres. In my repo, I also created an .env file to hold our parameters.

2

Dockerize it!

📝 From you code editor

Now we will need a Docker file and a docker-compose file. We use our Docker file to build our environment and you can find a full list of 'dictionary' options online. We use our docker-compose yaml file to create our server and container structures and then we can easily start or end the process in CLI.

3

View it!

Terminal & 🌐 web browser

To view our work on the front end, we need to docker-compose up -d to run it and then open it's location on our browser. For our project, we are using local host and port 8080 (for pgAdmin).

4

Use it!

🌐 web browser

Because our project end goal is being able to look at the data using SQL queries in pgAdmin, we now want to use it!

5

End

Terminal

When you're done with your docker-compose be sure to end it by running docker-compose down

Resources

📜 My repo for this summary section can be found here:

Not found

Last updated