tutor
tutor copied to clipboard
Do we still need to define `*-job` services in docker-compose?
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 todocker-compose.jobs.yml, but that should not be the case for most services. - Services that are
runbypass therestart-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 doexecagain?
Such a change would considerably simplify the project architecture.