From 3ec6435323580530af29926a90f1a922a9fb49f9 Mon Sep 17 00:00:00 2001
From: Marc Karassev <markarasev@protonmail.com>
Date: Thu, 18 Oct 2018 19:33:30 +0200
Subject: [PATCH] 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.

---
 docker-compose.yml           | 1 -
 docker/stretch/entrypoint.sh | 4 +---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/docker-compose.yml b/docker-compose.yml
index 0e771bae..f13a4b39 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -23,7 +23,6 @@ services:
             - 80:80
         environment:
             - ENV=dev
-            - DOMAIN=localhost
             - APP_NAME=Framadate
             - ADMIN_MAIL=mon@email.fr
             - MYSQL_USER=framadate
diff --git a/docker/stretch/entrypoint.sh b/docker/stretch/entrypoint.sh
index 01088d18..37b382bc 100755
--- a/docker/stretch/entrypoint.sh
+++ b/docker/stretch/entrypoint.sh
@@ -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
-- 
GitLab