如何在后台安排工作并在Docker容器中启动另一个过程?
我的问题非常接近其他问题,例如 and 这个使用cron
或无限循环
在Docker容器中安排单个作业/过程。
两种方法都对我有用,但是我的问题有些不同:我想
- 在后台安排一个工作/过程
- ,然后开始另一个过程。
在我的现实世界中,问题
- 是
etl流程
, - 是
django实例
(WebSever)。
我该如何以干净的方式做到这一点?
欢迎任何提示!
My question is quite close to other questions such as this one and this one which use cron
or an infinite loop
to schedule single a job/process inside a docker container.
Both approaches work for me but my problem is a bit different: I would like to
- schedule a job/process in the background
- and subsequently start another process.
In my real world problem:
- is an
ETL process
and - is a
Django instance
(websever).
How can I do this in a clean way?
Any hints are welcome!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我基于以下文章。
基本上,它基本上覆盖了另一个服务中的入口点,如
docker-compose.yml
文件:我的示例
dockerfile
:我的示例
cronjob
cronjob 带有一个带有一个重要的提示花了我数小时的错误跟踪:我发现该解决方案更加清洁,因为它仅使用一个每个容器的过程。
I found a solution using
docker-compose
based on the following article.It basically overrides the entrypoint in another service as follows in the
docker-compose.yml
file:My example
Dockerfile
:My example
cronjob
file with an important hint that took me hours of bugtracking:I found this solution much cleaner because it only uses one process per container.