robosats/scripts/entrypoint.sh

29 lines
937 B
Bash
Raw Permalink Normal View History

#!/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
# Collect static files
if [ $DEVELOPMENT ]; then
echo "Installing python development dependencies"
pip install -r requirements_dev.txt
fi
2023-05-17 09:27:19 +00:00
# Print first start up message when pb2/grpc files if they do exist
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 ."
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/
# Start server / gunicorn / daphne / command
exec "$@"