fix init script

This commit is contained in:
2025-06-09 12:24:31 +02:00
parent 2a3aad740e
commit 55600aae37
3 changed files with 12 additions and 9 deletions

View File

@@ -18,6 +18,7 @@ services:
ports: ports:
- "8080:8000" - "8080:8000"
environment: environment:
LARAVEL_DATABASE_TYPE: mariadb
LARAVEL_DATABASE_USER: laravel_user LARAVEL_DATABASE_USER: laravel_user
LARAVEL_DATABASE_PASSWORD: super_strong_password LARAVEL_DATABASE_PASSWORD: super_strong_password
LARAVEL_DATABASE_NAME: laravel_db LARAVEL_DATABASE_NAME: laravel_db

View File

@@ -1,7 +1 @@
DB_CONNECTION=mariadb APP_KEY=
DB_HOST=mariadb
DB_PORT=3306
DB_DATABASE=laravel_db
DB_USERNAME=laravel_user
DB_PASSWORD=super_strong_password
APP_KEY=""

View File

@@ -1,5 +1,12 @@
#!/bin/sh #!/bin/sh
# Init the laravel directory
if ! [ -d "app" ] ; then
/opt/bitnami/scripts/laravel/entrypoint.sh /opt/bitnami/scripts/laravel/run.sh
else
composer install composer install
fi
# Create .env if it does not exist # Create .env if it does not exist
if ! [ -e ".env" ] ; then if ! [ -e ".env" ] ; then
@@ -8,4 +15,5 @@ if ! [ -e ".env" ] ; then
fi fi
php artisan migrate --force php artisan migrate --force
php artisan serve --host=0.0.0.0 --port=8000
/opt/bitnami/scripts/laravel/entrypoint.sh /opt/bitnami/scripts/laravel/run.sh