2017-02-17 08:45:48 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
2017-02-17 10:28:42 +00:00
|
|
|
mkdir -p /run/php/sessions
|
|
|
|
|
2017-02-17 08:45:48 +00:00
|
|
|
if ! [ -f /app/data/.installed ]; then
|
|
|
|
echo "Fresh installation, setting up..."
|
|
|
|
rsync -a /app/code/data-orig/ /app/data/
|
2017-02-23 14:25:53 +00:00
|
|
|
php cli/do-install.php \
|
|
|
|
--environment production --default_user admin \
|
|
|
|
--db-type mysql --db-host "${MYSQL_HOST}:${MYSQL_PORT}" \
|
|
|
|
--db-user "${MYSQL_USERNAME}" --db-password "${MYSQL_PASSWORD}" \
|
|
|
|
--db-base "${MYSQL_DATABASE}"
|
|
|
|
php cli/create-user.php --user admin --password password --language en
|
|
|
|
php cli/actualize-user.php --user admin
|
2017-02-17 08:45:48 +00:00
|
|
|
touch /app/data/.installed
|
|
|
|
echo "Done."
|
|
|
|
fi
|
|
|
|
|
2017-02-18 10:51:44 +00:00
|
|
|
mkdir -p /app/data/extensions
|
|
|
|
for f in $(ls /app/code/extensions-orig); do
|
|
|
|
if ! [ -e "/app/data/extensions/$f" ]; then
|
|
|
|
ln -s "/app/code/extensions-orig/$f" "/app/data/extensions/$f"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2017-02-23 14:25:53 +00:00
|
|
|
|
2017-02-17 08:45:48 +00:00
|
|
|
echo "Creating config file"
|
2017-02-23 14:25:53 +00:00
|
|
|
php set_config.php
|
|
|
|
|
2017-02-17 08:45:48 +00:00
|
|
|
|
2017-02-23 14:25:53 +00:00
|
|
|
echo "Setting permissions"
|
2017-02-17 10:28:42 +00:00
|
|
|
chown -R www-data.www-data /run/php /app/data
|
2017-02-17 08:45:48 +00:00
|
|
|
|
2017-02-23 14:25:53 +00:00
|
|
|
|
2017-02-17 08:45:48 +00:00
|
|
|
echo "Starting apache"
|
|
|
|
APACHE_CONFDIR="" source /etc/apache2/envvars
|
|
|
|
rm -f "${APACHE_PID_FILE}"
|
|
|
|
exec /usr/sbin/apache2 -DFOREGROUND
|