Made docker-compose generate a configuration forcing the domain to be set to $_SERVER['SERVER_NAME'] in order to properly get assets while accessing the website from another device.

This commit is contained in:
Marc Karassev 2018-10-18 19:33:30 +02:00 committed by Paul B
parent b58e61c575
commit 3ec6435323
No known key found for this signature in database
GPG Key ID: DE331B23748D3A27
2 changed files with 1 additions and 4 deletions

View File

@ -23,7 +23,6 @@ services:
- 80:80
environment:
- ENV=dev
- DOMAIN=localhost
- APP_NAME=Framadate
- ADMIN_MAIL=mon@email.fr
- MYSQL_USER=framadate

View File

@ -19,9 +19,7 @@ if [ ! -f $FRAMADATE_CONFIG ]; then
echo "There is no configuration file. Create one with environment variables"
cp /var/www/framadate/tpl/admin/config.tpl $FRAMADATE_CONFIG
# Set values on configuration file
if [ ! -z "$DOMAIN" ]; then
sed -i -E "s/^(\/\/ )?const APP_URL( )?=.*;/const APP_URL = '$DOMAIN';/g" $FRAMADATE_CONFIG
fi
sed -i -E "s/^(\/\/ )?const APP_URL( )?=.*;/const APP_URL = '$DOMAIN';/g" $FRAMADATE_CONFIG
if [ "$FORCE_HTTPS" = true ]; then
sed -i -E "s/^(\/\/ )?const FORCE_HTTPS\\s*=.*;/const FORCE_HTTPS = true;/" $FRAMADATE_CONFIG
fi