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.
This commit is contained in:
Alex Headley
2019-01-15 12:02:59 -05:00
committed by Nicolas F
parent a6d800b4ca
commit 18ebf134d5
12 changed files with 343 additions and 0 deletions

32
.docker/entrypoint-sync.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/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