How use docker as Frontend Engineer

I am a beginner learning Docker, and I have already installed Docker Desktop on my PC. I can create Docker images and run containers from these images, but I am struggling to understand their usefulness.

If I upload my project to GitHub, others can download it using git clone. Alternatively, should I upload the image to Docker Hub so that they can pull the image to their machines and run a container from it? After every update to my project’s code, do I need to generate a new image and upload it to Docker Hub?

Also, if I use environment variables from a .env file in my project, how can I add those to the container to run it? What is Docker Compose, and why should I use it?

I know I have many questions and probably need a course, but I would appreciate some clarification to understand the correct path before I start searching for resources. Thanks!uld appreciate some clarification to understand the correct path before I start searching for resources. Thanks!

Yes that would be the process, but you’re in luck!
Github can do it for you when you fx. push/merge your code:

You can add your env file to a container, when creating the container, docker run --env-file…

Docker compose, you should see it as a recipe for your container, so you dont have to memories your docker run command, and all its parameters, when you have your docker-compose file, you can just write “docker compose up -d” and it will create the container, for the information in that file, more about that, here: Docker Compose | Docker Docs

Thanks @terpz i will search about these things that you mentioned