Verified Commit e88fc05c authored by Romain Maliach-Auguste's avatar Romain Maliach-Auguste 🌵
Browse files

We must wait for the WEB server to start

parent 006229eb
......@@ -9,4 +9,6 @@ RUN carton install
COPY ./docker/init /
ENV READ_FILE_API_KEY_RETRIES 10
ENV READ_FILE_API_KEY_DELAY_BETWEEN_RETRIES_SECONDS 30
ENV QUERY_API_RETRIES 10
ENV QUERY_API_DELAY_BETWEEN_RETRIES_SECONDS 30
ENTRYPOINT ["/init"]
......@@ -4,6 +4,12 @@ api_key_retry_delay=$READ_FILE_API_KEY_DELAY_BETWEEN_RETRIES_SECONDS
while [ $retries -gt 0 ] && [ -v $(cat $APIKEY_PATH) ] ; do >&2 echo "APIKEY file (at $APIKEY_PATH ) must contain the etherpad instance's API key. Copy (or mount) it. It is generated by etherpad-lite at startup and placed in its root (usually /opt/etherpad-lite/APIKEY.txt). We'll trying again $retries more time(s), after having slept $api_key_retry_delay seconds."; sleep $api_key_retry_delay; let retries--; done
if [ $retries == 0 ] ; then >&2 echo "Failed to find APIKEY file (at $APIKEY_PATH ), aborting."; exit 1; fi
let retries=$QUERY_API_RETRIES
retry_delay=$QUERY_API_DELAY_BETWEEN_RETRIES_SECONDS
curl $URL
while [ $? -ne 0 ] && [ $retries -gt 0 ]; do >&2 echo "Could not contact the server at $URL. We'll trying again $retries more time(s), after having slept $retry_delay seconds."; sleep $retry_delay; let retries--; curl $URL ; done
if [ $retries == 0 ] ; then >&2 echo "Failed to contact the server (at $URL ), aborting."; exit 1; fi
CF=/etc/delete_after_delay.yml
echo 'instanceD:' > $CF
echo " key: $(cat $APIKEY_PATH)" >> $CF
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment