Skip to content

Commit

Permalink
Fix entrypoint for server image
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas committed Nov 26, 2017
1 parent 9dd3f9d commit 08354d4
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion docker/server/entry.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
#!/bin/bash
node /opt/server/index.js &
echo "Starting flask..."
python /opt/cnn_model/app.py &

echo "Starting node..."
node /opt/server/index.js &

while /bin/true; do
ps aux |grep app.py |grep -q -v grep
PROCESS_1_STATUS=$?
ps aux |grep index.js |grep -q -v grep
PROCESS_2_STATUS=$?

# If the greps above find anything, they will exit with 0 status
# If they are not both 0, then something is wrong
if [ $PROCESS_1_STATUS -ne 0 -o $PROCESS_2_STATUS -ne 0 ]; then
echo "Process exit."
exit -1
fi
sleep 60
done

0 comments on commit 08354d4

Please sign in to comment.