How can one understand what is necessary for the DockerFile and Docker Compose file?

How can one determine what should be included in the docker compose file? For example if I want to make a Django website, how do I know what services to include in the file and what keywords to use?
Many of the tutorials on YouTube and on the docker tutorial website specify certain projects for their specific needs, but what about the specific needs of my project?

Also do I need a container for every developer tool I use? For example one container for postgress and one for django? I have been told yes. How do I create another container inside a docker file pulled for ptyhon for postgress. If its already set up with a python image how
I have already viewed the getting started docker tutorial and visited a cloud guru, YouTube, and the dive into docker course.
What is you approach to dockerizing your project?

Docker containers are used to isolate processed. It’s best practice to have a separate service/container for every component. For example one for the proxy, one for app, one for database.

“Separation of concerns”

That way processes can not interfere with one another, they might use different (versions of) dependencies, they can be upgraded separately. They can be scaled separately.

Best practice is to use a common Docker network to connect the Docker services/containers to talk to each other.

There are MANY tutorials out there, maybe you started with the wrong one.

That’s why people learn for years so they can understand the documentation and use tutorials for more ideas so they can put the pieces together and solve their specific case. You can also hire a consultant.

I always say that Docker is not a magic wand. You need to learn about the operating system (Linux, Windows), the containerization concept in general, some knowledge about the kernel can help too.

So Docker is just a tool. If you know how to write a software that is well-organized and the components can communicate through the network, and you also know how to write a software that can be installed without user interaction, then you can use Docker to containerize it. The fact that Docker Desktop provides some ways to initialize a project (which was suggested by @meyay: How to create a Dockerfile and dockercompose.yml file - #2 by meyay) is nice, but that is just to start when you have no idea how to do that. how many containers you create is up to you. You could have everything in one container, which is absolutely not recommended, or have a container for each component which makes sense only if those components are individual entities an can communicate with eachother through the network or they don’t need to communicate.

Tutorials can focus on a specific goal and show you some useful features or show gneral ideas which is like learnig about multiplication, but it won’t tell you what is the result of 7876871312 multiplied by 976382676 ( typed random numbers).

I also have this message snippet to share recommended tutorials (including mine) to learn about the basics

Recommended links to learn the basics and concepts:

The last link is (currently) about Docker Desktop which is Docker CE in a virtual machine whith a GUI.