Improved docker-compose to handle server_address. Also added an option to run without nginx.

This commit is contained in:
Eduardo Silva 2024-02-16 11:59:03 -03:00
parent 5e598deba3
commit 6a2648ddf7
7 changed files with 118 additions and 26 deletions

22
entrypoint.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
set -e
if [ -z "$SERVER_ADDRESS" ]; then
echo "SERVER_ADDRESS environment variable is not set. Exiting."
exit 1
fi
DEBUG_VALUE="False"
if [[ "${DEBUG_MODE,,}" == "true" ]]; then
DEBUG_VALUE="True"
fi
cat > /app/wireguard_webadmin/production_settings.py <<EOL
DEBUG = $DEBUG_VALUE
ALLOWED_HOSTS = ['$SERVER_ADDRESS']
CSRF_TRUSTED_ORIGINS = ['https://$SERVER_ADDRESS']
SECRET_KEY = '$(openssl rand -base64 32)'
EOL
exec "$@"