tutor icon indicating copy to clipboard operation
tutor copied to clipboard

Do we still need to define `*-job` services in docker-compose?

Open regisb opened this issue 3 years ago • 0 comments

It seems to me that we could simply docker-compose run service sh -e -c "command". Why do we have to rely on a convoluted job architecture?

  • Jobs don't add anything in terms of environment variables, volume mounting or dependencies.
  • If a service must be present in jobs, but not started as a long-running service (e.g: mysql when RUN_MYSQL=false) then we can add it to docker-compose.jobs.yml, but that should not be the case for most services.
  • Services that are run bypass the restart-policy, which is good.
  • We stopped doing k8s exec (here) because this caused us to bypass environment variables set by the Docker entrypoint. But since we no longer define env variables in the entrypoint, can we do exec again?

Such a change would considerably simplify the project architecture.

regisb avatar Apr 19 '22 10:04 regisb