You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixelfed/docker/shared/root/docker/entrypoint.d/11-first-time-setup.sh

23 lines
756 B
Bash

#!/bin/bash
source /docker/helpers.sh
entrypoint-set-script-name "$0"
# Allow automatic applying of outstanding/new migrations on startup
: ${DOCKER_RUN_ONE_TIME_SETUP_TASKS:=1}
if is-false "${DOCKER_RUN_ONE_TIME_SETUP_TASKS}"; then
log-warning "Automatic run of the 'One-time setup tasks' is disabled."
log-warning "Please set [DOCKER_RUN_ONE_TIME_SETUP_TASKS=1] in your [.env] file to enable this."
exit 0
fi
load-config-files
await-database-ready
only-once "storage:link" run-as-runtime-user php artisan storage:link
only-once "key:generate" run-as-runtime-user php artisan key:generate
only-once "initial:migrate" run-as-runtime-user php artisan migrate --force
only-once "import:cities" run-as-runtime-user php artisan import:cities