1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 20:19:59 +00:00
nyaa/.docker/entrypoint-sync.sh
Alex Headley 18ebf134d5 feature: docker development environment (#544)
Add docker support

It's self-contained so should not interfere with anything else and can easily be thrown out if nobody wants it anymore.
2019-01-15 18:02:59 +01:00

33 lines
660 B
Bash
Executable file

#!/bin/bash
# set +x
pushd /nyaa
echo 'Waiting for MySQL to start up'
while ! echo HELO | nc mariadb 3306 &>/dev/null; do
sleep 1
done
echo 'DONE'
echo 'Waiting for ES to start up'
while ! echo HELO | nc elasticsearch 9200 &>/dev/null; do
sleep 1
done
echo 'DONE'
echo 'Waiting for ES to be ready'
while ! curl -s -XGET 'elasticsearch:9200/_cluster/health?pretty=true&wait_for_status=green' &>/dev/null; do
sleep 1
done
echo 'DONE'
echo 'Waiting for sync data file to exist'
while ! [ -f /elasticsearch-sync/pos.json ]; do
sleep 1
done
echo 'DONE'
echo 'Starting the sync process'
/usr/bin/python3 /nyaa/sync_es.py /nyaa/.docker/es_sync_config.json