Packaging fixes

This commit is contained in:
badblocks 2025-05-08 21:08:12 -07:00
parent fa6103d007
commit 959b06c425
19 changed files with 389 additions and 68 deletions

View file

@ -1,13 +1,23 @@
#!/bin/bash
set -exc
set -ex
# Load environment variables from .env file if it exists in /code/
if [ -f /.env ]; then
echo "Loading environment variables from .env"
# Set allexport option to export all variables defined by sourcing the .env file.
set -a
source /.env
# Unset allexport option.
set +a
else
echo "Warning: Volume mount for /.env file not found. Make sure you are using env_file in docker-compose.yml or mounting it in the container."
fi
# check if the startup command has been provided
if [ "$1" == "" ]; then
echo "Startup command not set. Exiting"
exit;
fi
# check if the $DJANGO_SETTINGS_MODULE environment variable has been set
if [ "$DJANGO_SETTINGS_MODULE" == "" ]; then
echo "Environment variable 'DJANGO_SETTINGS_MODULE' not set. Exiting."
exit;
@ -15,6 +25,7 @@ else
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
fi
echo "Running deploy.sh..."
/deploy.sh
echo "Enviroment is correct and deploy.sh has been run - executing command: '$@'"