added synchronization with conductor

This commit is contained in:
dcore94 2020-07-17 12:53:05 +02:00
parent 1cbb281f39
commit 3a5c9dff64
2 changed files with 15 additions and 10 deletions

View File

@ -1,13 +1,7 @@
FROM python:3.7
COPY requirements.txt /
RUN pip install -r /requirements.txt
COPY conductor/ /app/conductor
COPY pyexecplugins/ /app/pyexecplugins
COPY pyrest.py /app
COPY pyexec.py /app
COPY config.cfg /app
COPY setup.py /app
COPY entrypoint.sh /app
RUN chmod 755 /app/entrypoint.sh
COPY requirements.txt pyrest.py pyexec.py config.cfg entrypoint.sh /app/
RUN pip install -r /app/requirements.txt
WORKDIR /app
ENTRYPOINT ["./entrypoint.sh"]
ENTRYPOINT ["/app/entrypoint.sh"]

13
entrypoint.sh Normal file → Executable file
View File

@ -1,4 +1,15 @@
#!/bin/sh
#!/bin/bash
export BASE="http://conductorserver:8080/api"
echo 'Waiting for Conductor ...'
while [[ "$(curl -s -o /dev/null -L -w ''%{http_code}'' $BASE/health)" != 200 ]]; do
echo 'still waiting ...'
sleep 5
done
echo 'Starting workers...'
python3 pyrest.py &
python3 pyexec.py