I have Flask application container which has to run on port 5000.
I also have a background process which is related to queue. This process has an infinite loop which is why I want to run it in background.
I'm using docker-compose.yml file for creating container. For now, I'm able to run only one command which is to make the flask server up.
flask run --host=0.0.0.0 --port 5000
. I'm using the command
option in docker-compose .
This is the command I want to run in background python app/workload/services/queue_services.py > qlog.txt
.
When I put the background command first in command
, the server is not coming up and I'm only seeing the output from background script.
When I put the flask run
command first, the background script is not starting at all.
Is there any proper way to run these two commands on container start up?