diff --git a/abra.sh b/abra.sh index 72e8557..71d52e4 100644 --- a/abra.sh +++ b/abra.sh @@ -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..." diff --git a/compose.yml b/compose.yml index 66588bb..48db059 100644 --- a/compose.yml +++ b/compose.yml @@ -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