Below is my docker enterypoint.sh file code
#!/bin/bash
set -e
python3 test1.py
gunicorn -b 0.0.0.0:8000 "app:app" --workers=1 --threads=10 --timeout=3600
node /home/test2.js
I want to run test2.js nodejs app after gunicorn service starts because test2.js required to connect with localhost:8000. Please help me with a solution for this
3
Answers
Think the ideal solution will be to deploy 2 different containers using docker-compose, one for gunicorn and another one for test2.js nodejs app.
But could run test2.js nodejs script after starting gunicorn service using below code by inserting "&" at the end of gunicorn line
By default, the next line is only executed after the previous one, but maybe the command ends before the port is active, so you can use a while to check that
Try this :