Skip to content
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

Disable automatic execution of setup service via Compose profile #798

Closed
antoineco opened this issue Dec 6, 2022 · 2 comments
Closed

Disable automatic execution of setup service via Compose profile #798

antoineco opened this issue Dec 6, 2022 · 2 comments
Labels
discuss General discussion threads, suggestions for improvements, etc. feature request Requests for new features, such as additional configurations or extensions

Comments

@antoineco
Copy link
Collaborator

antoineco commented Dec 6, 2022

A thread to discuss whether or not it would make sense to guard the execution of the setup script using a Compose profile.

Context

This mechanism allows excluding selected services from regular executions of docker-compose up, unless those services are explicily listed on the command line. It is particularly useful for one-offs (init scripts, ...), automated tests, etc.

We already leverage profiles on the tls branch for generating TLS certificates and private keys using docker-compose up tls:

tls:
profiles:
- setup

Proposal

I've been thinking about using the same mechanism for the setup script.

Right now, setup runs on every execution of docker-compose up (and exits when done). This is fine because, upon successful execution, the script creates a lock file to prevent subsequent runs and avoid overriding existing roles and users on every startup.

However, creating this container every time isn't essential, and we could as well document the fact that people need to run docker-compose up setup the first time they spin up their stack.

✅ Pros ❌ Cons
Explicit, clear intent Must be run manually (once)
Setup output not tangled with verbose ES logs Requires Compose 1.28.0
No unnecessary container creation
No lock to delete manually to re-execute the setup
@antoineco antoineco added discuss General discussion threads, suggestions for improvements, etc. feature request Requests for new features, such as additional configurations or extensions labels Dec 6, 2022
@nikgame33
Copy link

Adding an additional setup profile seems worth the change, the added work of running an additional command the cleaner output and re executing is made easier. Therefore I'd say the Pros outweigh the Cons, at least from personal experience

@antoineco
Copy link
Collaborator Author

@nikgame33 appreciate the feedback, thanks!

The only thing I'm worried about is people who don't read the docs (there are very very many) and will open issues asking why things don't work when they clone the repository and run docker compose up.

I guess we could make it clear by adding a tl;dr with the commands to run at the very top of the README, and updating the demo GIF.

antoineco added a commit that referenced this issue May 2, 2023
DanBrown47 pushed a commit to DanBrown47/docker-elk that referenced this issue Jun 22, 2023
DanBrown47 pushed a commit to DanBrown47/docker-elk that referenced this issue Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss General discussion threads, suggestions for improvements, etc. feature request Requests for new features, such as additional configurations or extensions
Projects
None yet
Development

No branches or pull requests

2 participants