entry.sh 618 Bytes
Newer Older
1 2
#!/bin/bash

3 4
sh `dirname $0`/init_logs.sh

5 6 7 8 9 10 11 12
# Script to make sure that assets from the frontend have been generated at least
# once so that the backend container doesn't crash on the first launch.

while [ ! -f `dirname $0`/../frontend/webpack-stats.json ]; do
    echo "Waiting for frontend static files to be initialized..."
    sleep 2
done

13 14 15 16 17
while ! grep -q '"status":"done"' `dirname $0`/../frontend/webpack-stats.json; do
    echo "Waiting for frontend static files to be initialized..."
    sleep 2
done

18
echo "Frontend staticfiles are ready (NB: not necessarly up-to-date)."
19

20
./manage.py collectstatic --noinput