better docker scripts
This commit is contained in:
7
images/.env
Normal file
7
images/.env
Normal file
@@ -0,0 +1,7 @@
|
||||
DB_CONNECTION=mariadb
|
||||
DB_HOST=mariadb
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=laravel_db
|
||||
DB_USERNAME=laravel_user
|
||||
DB_PASSWORD=super_strong_password
|
||||
APP_KEY=""
|
||||
@@ -4,4 +4,9 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | ba
|
||||
|
||||
RUN . ~/.nvm/nvm.sh && nvm install --lts
|
||||
|
||||
RUN composer require laravel/breeze --dev
|
||||
COPY init_laravel.sh /init/init_laravel.sh
|
||||
COPY .env /init/.env
|
||||
|
||||
RUN chmod +x /init/init_laravel.sh
|
||||
|
||||
CMD bash /init/init_laravel.sh
|
||||
@@ -1,3 +0,0 @@
|
||||
composer require laravel/breeze --dev
|
||||
php artisan breeze:install blade
|
||||
php artisan migrate
|
||||
12
images/init_laravel.sh
Normal file
12
images/init_laravel.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
composer install
|
||||
|
||||
# Create .env if it does not exist
|
||||
if ! [ -e ".env" ] ; then
|
||||
cp /init/.env .
|
||||
php artisan key:generate
|
||||
fi
|
||||
|
||||
php artisan breeze:install blade
|
||||
php artisan migrate --force
|
||||
php artisan serve --host=0.0.0.0 --port=8000
|
||||
Reference in New Issue
Block a user