Files
docker/run.sh
T
Michal Čihař a5dfdfe993 Move user configuration and simplify it's setup
- move it to root directory to make it easier to use as volume

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-08 13:09:32 +02:00

20 lines
531 B
Bash
Executable File

#!/bin/sh
set -x
if [ ! -f /www/config.secret.inc.php ] ; then
cat > /www/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '`cat /dev/urandom | tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' | fold -w 32 | head -n 1`';
EOT
fi
if [ ! -f /config.user.inc.php ] ; then
touch /config.user.inc.php
fi
exec php -S 0.0.0.0:80 -t /www/ \
-d upload_max_filesize=$PHP_UPLOAD_MAX_FILESIZE \
-d post_max_size=$PHP_UPLOAD_MAX_FILESIZE \
-d max_input_vars=$PHP_MAX_INPUT_VARS \
-d session.save_path=/sessions