This commit is contained in:
blu 2024-03-18 11:57:37 +01:00
parent 90ef71eaff
commit 2e34b2f16a
Signed by: blu
GPG Key ID: 9DF47BD2E647A7D6
2 changed files with 14 additions and 4 deletions

14
abra.sh
View File

@ -1,14 +1,24 @@
ENTRYPOINT_CONF_VERSION=v1
echo "### Entering abra.sh ..."
export ENTRYPOINT_CONF_VERSION=v1
export DB_PASSWORD=$(cat /run/secrets/db_password)
### Helpers
# these commands can be run via: abra app cmd open-inventory.example.net app $commandName ($commandName: clear_cache, ...)
# these commands can be run via:
# abra app cmd open-inventory.example.net app $commandName
# where $commandName = {clear_cache, initial_setup, ...}
initial_setup() {
cd /app/
# init .env file, we only use it for the APP_KEY, as the other variables, are exported by Docker as env vars
echo "APP_KEY=" > .env
echo "Generating APP_KEY..."
php artisan key:generate
php vars.php # TODO: remove! it's a debug
echo "DB migrations status:"
php artisan migrate:status
echo "Starting DB migrations..."

View File

@ -44,8 +44,8 @@ services:
environment:
- MYSQL_DATABASE=open-inventory
- MYSQL_USER=open-inventory
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
- FILE__MYSQL_PASSWORD=/run/secrets/db_password
- FILE__MYSQL_ROOT_PASSWORD=/run/secrets/db_root_password
secrets:
- db_password
- db_root_password