Files
monica/scripts/docker/test-server.sh
T
Alexis Saettler 851ba981f6 Docker run real cron (#906)
* Use crontab for schedules
* Update apache conf file
* Clean composer cache after installation
* Clean apk cache after installation
2018-02-22 22:27:36 +01:00

28 lines
708 B
Bash
Executable File

#!/bin/sh
MONICADIR=/var/www/monica
ARTISAN="php ${MONICADIR}/artisan"
if [[ -z ${APP_KEY:-} || "$APP_KEY" == "ChangeMeBy32KeyLengthOrGenerated" ]]; then
${ARTISAN} key:generate --no-interaction
else
echo "APP_KEY already set"
fi
${ARTISAN} migrate --force
${ARTISAN} storage:link
${ARTISAN} db:seed --class ActivityTypesTableSeeder --force
${ARTISAN} db:seed --class CountriesSeederTable --force
# Ensure storage directories are present
STORAGE=${MONICADIR}/storage
mkdir -p ${STORAGE}/{logs,app/public,framework/views,framework/cache,framework/sessions}
chown -R monica:apache ${STORAGE}
chmod -R g+rw ${STORAGE}
# Run cron
crond -b &
# Run apache2
rm -f /run/apache2/httpd.pid
httpd -DFOREGROUND