Skip to content

docker-compose-optimization #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vanodevium
Copy link

Hi! This project looks awesome, really!

I try to optimize docker-compose.yml for common use cases:

  • there is no need for container names because internal docker dns uses service names as endpoint also
  • also there is no need to change internal service ports, please support changes only for exposed ports, not internal
  • docker-compose version tag is deprecated now
  • set project name for global namespace
  • there is 2025 year... .env file have to be in .gitignore

I also think that there is no point in cloning the repository to run this project.

So it is enough to describe only two points in the readme:

  • how to use curl and download docker-compose.yml only
  • what variables can be set into the .env file

@adanb13
Copy link
Contributor

adanb13 commented May 29, 2025

Hi, just wanted to note that we have seen this and will get to it in some time - thanks for the suggestions, at first glance they look very appropraite

@adanb13 adanb13 mentioned this pull request May 29, 2025
@Jekotia
Copy link

Jekotia commented Jun 4, 2025

There IS a use case for container names: having human-readable container names in docker ps output, and any tools that let you view running containers on a docker host (e.g. Portainer, Komodo). Without defining this field, the container is given a random identifier for the name.

@vanodevium
Copy link
Author

@Jekotia

Fortunately, the name is never random and is built according to very clear rules.

I only removed them because these names were used for DNS resolution

@Jekotia
Copy link

Jekotia commented Jun 4, 2025

@vanodevium I'll have to test later then. My experience had previously been that the name is akin to a commit hash. Seemingly-random generated gibberish that corresponds to something internally. Now I'm left wondering if that got changed, or if I misunderstood what was happening before 🤔

@vanodevium vanodevium force-pushed the docker-compose-optimization branch from 1d58bcd to 43b25a1 Compare June 4, 2025 16:48
@vanodevium
Copy link
Author

@Jekotia

Most likely, you are a little confused about what names are assigned by docker.

When a container is started within a compose, the name is built according to approximately this rule:

(project or cwd) + service name + number of scale (default 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants