fix: Ensure deploy script runs once and is part of entrypoint
The deploy.sh script is now re-added to the entrypoint.sh script to ensure it runs only during first container startup. A flag file (/flags/.deployed) is now created after a successful deployment. The deploy.sh script checks for this flag and will not re-run deployment steps unless FORCE_DEPLOY is set to true. This prevents unnecessary re-runs of migrations, collectstatic, etc., on subsequent container starts within the same deployment. Corrected permissions for `/app/.cursor-server` and created a `/flags` directory with appropriate permissions in the `Dockerfile`. Added ENV DJANGO_SETTINGS_MODULE with default value to `Dockerfile`.
This commit is contained in:
parent
c87d73435b
commit
d4948e7cd3
3 changed files with 21 additions and 8 deletions
|
|
@ -2,16 +2,18 @@
|
|||
set -ex
|
||||
|
||||
if [ "$1" == "" ]; then
|
||||
echo "Startup command not set. Exiting"
|
||||
exit;
|
||||
echo "Startup command not set. Exiting"
|
||||
exit;
|
||||
fi
|
||||
|
||||
if [ "$DJANGO_SETTINGS_MODULE" == "" ]; then
|
||||
echo "Environment variable 'DJANGO_SETTINGS_MODULE' not set. Exiting."
|
||||
exit;
|
||||
echo "Environment variable 'DJANGO_SETTINGS_MODULE' not set. Exiting."
|
||||
exit;
|
||||
else
|
||||
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
|
||||
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
|
||||
fi
|
||||
|
||||
/deploy.sh
|
||||
|
||||
echo "Environment is correct - executing command: '$@'"
|
||||
exec "$@" && exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue