Compare commits

...

3 Commits

4 changed files with 11 additions and 1 deletions

0
Dockerfile Normal file → Executable file
View File

3
docker-compose.yml Normal file → Executable file
View File

@ -25,6 +25,7 @@ services:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: laravel container_name: laravel
user: "1000:1000" # Match the host user's UID:GID
depends_on: depends_on:
mysql: mysql:
condition: service_healthy condition: service_healthy
@ -37,6 +38,7 @@ services:
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
command: ["/var/www/html/start.sh"]
command: > command: >
sh -c "sleep 10 && php artisan migrate --force && php-fpm" sh -c "sleep 10 && php artisan migrate --force && php-fpm"
restart: unless-stopped restart: unless-stopped
@ -62,3 +64,4 @@ networks:
volumes: volumes:
mysql-data: mysql-data:
mysql-data:

0
nginx/default.conf Normal file → Executable file
View File

7
start.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
sleep 10
if [ -z "$(grep '^APP_KEY=' /var/www/html/.env)" ]; then
php artisan key:generate
fi
php artisan migrate --force
php-fpm