2023-05-15 09:46:59 +00:00
#!/bin/sh
# Apply migrations
python manage.py migrate
# Collect static files
if [ $SKIP_COLLECT_STATIC ] ; then
echo "Skipping collection of static files."
else
python manage.py collectstatic --noinput
fi
2023-05-17 09:27:19 +00:00
# Print first start up message when pb2/grpc files if they do exist
2023-05-15 09:46:59 +00:00
if [ ! -f "/usr/src/robosats/api/lightning/lightning_pb2.py" ] ; then
2023-05-17 09:27:19 +00:00
echo "Looks like the first run of this container. pb2 and gRPC files were not detected on the attached volume, copying them into the attached volume /robosats/api/lightning ."
2023-05-15 09:46:59 +00:00
fi
2023-05-17 09:27:19 +00:00
# Copy and overwrite all existing pb2/grpc files always. Therefore, running
# /scripts/generate_grpc.sh only makes sense if done during Dockerfile build
cp -R /tmp/* /usr/src/robosats/api/lightning/
2023-05-15 09:46:59 +00:00
# Start server / gunicorn / daphne / command
exec " $@ "