Add support for a root path
This commit is contained in:
parent
8fb5846cd0
commit
4f3ba3d52c
@ -42,4 +42,5 @@ ENV AUTH_METHOD internal
|
||||
# always re-configure database with current ENV when RUNning container, then monitor all services
|
||||
ADD configure-db.php /configure-db.php
|
||||
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
CMD php /configure-db.php && supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
19
entrypoint.sh
Executable file
19
entrypoint.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# remove trailing / if any.
|
||||
SELF_URL_PATH=${SELF_URL_PATH/%\//}
|
||||
|
||||
# extract the root path from SELF_URL_PATH (i.e http://domain.tld/<root_path>).
|
||||
ROOT_PATH=${SELF_URL_PATH/#http*\:\/\/*\//}
|
||||
if [ "${ROOT_PATH}" == "${SELF_URL_PATH}" ]; then
|
||||
# no root path in SELF_URL_PATH.
|
||||
mkdir -p /var/tmp
|
||||
ln -s "/var/www" "/var/tmp/www"
|
||||
else
|
||||
mkdir -p /var/tmp/www
|
||||
ln -s "/var/www" "/var/tmp/www/${ROOT_PATH}"
|
||||
fi
|
||||
|
||||
php /configure-db.php
|
||||
exec supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
@ -1,6 +1,6 @@
|
||||
server {
|
||||
listen 80;
|
||||
root /var/www;
|
||||
root /var/tmp/www;
|
||||
|
||||
index index.php index.html;
|
||||
|
||||
@ -15,4 +15,3 @@ server {
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user