I have compose.yml
file:
api:
restart: on-failure
command: uvicorn app:app
...
jobs:
restart: on-failure
command: python job.py
...
job.py
:
import asyncio
from prometheus_client import start_http_server
async def background(sio):
await asyncio.gather(...) # <- there are many tasks with while True
start_http_server(5000)
asyncio.run(background(sio))
It works okay. After stopping everything turns off. But when I restart system, jobs
container starting automatically. Why?! api
is not starting, but why jobs
starting?