2024-01-05 17:29:45 +00:00
|
|
|
#!/bin/bash
|
2024-01-15 17:16:00 +00:00
|
|
|
: "${ENTRYPOINT_ROOT:="/docker"}"
|
|
|
|
|
|
|
|
# shellcheck source=SCRIPTDIR/../helpers.sh
|
|
|
|
source "${ENTRYPOINT_ROOT}/helpers.sh"
|
2024-01-05 17:29:45 +00:00
|
|
|
|
|
|
|
entrypoint-set-script-name "$0"
|
|
|
|
|
2024-01-15 15:32:29 +00:00
|
|
|
# Allow automatic applying of outstanding/new migrations on startup
|
2024-01-15 17:16:00 +00:00
|
|
|
: "${DOCKER_RUN_ONE_TIME_SETUP_TASKS:=1}"
|
2024-01-15 15:32:29 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2024-01-06 18:01:48 +00:00
|
|
|
load-config-files
|
2024-01-05 23:16:26 +00:00
|
|
|
await-database-ready
|
2024-01-05 17:29:45 +00:00
|
|
|
|
2024-01-05 23:16:26 +00:00
|
|
|
only-once "key:generate" run-as-runtime-user php artisan key:generate
|
2024-01-17 14:29:24 +00:00
|
|
|
only-once "storage:link" run-as-runtime-user php artisan storage:link
|
2024-01-05 23:16:26 +00:00
|
|
|
only-once "initial:migrate" run-as-runtime-user php artisan migrate --force
|
|
|
|
only-once "import:cities" run-as-runtime-user php artisan import:cities
|
2024-01-17 14:29:24 +00:00
|
|
|
|
|
|
|
if is-true "${ACTIVITY_PUB:-false}"; then
|
|
|
|
only-once "instance:actor" run-as-runtime-user php artisan instance:actor
|
|
|
|
fi
|
|
|
|
|
|
|
|
if is-true "${OAUTH_ENABLED:-false}"; then
|
|
|
|
only-once "passport:keys" run-as-runtime-user php artisan passport:keys
|
|
|
|
fi
|