diff --git a/.env.example b/.env.example index 35db1dd..e4808a7 100755 --- a/.env.example +++ b/.env.example @@ -20,12 +20,12 @@ LOG_STACK=single LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug -DB_CONNECTION=sqlite -# DB_HOST=127.0.0.1 -# DB_PORT=3306 -# DB_DATABASE=laravel -# DB_USERNAME=root -# DB_PASSWORD= +DB_CONNECTION=mysql +DB_HOST=mysql +DB_PORT=3306 +DB_DATABASE=laravel +DB_USERNAME=laravel +DB_PASSWORD=secret SESSION_DRIVER=database SESSION_LIFETIME=120 diff --git a/docker-compose.yml b/docker-compose.yml index 619225f..3bd8d49 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,12 +33,12 @@ services: networks: - app-network healthcheck: - test: ["CMD", "php", "artisan", "config:cache"] + test: ["CMD", "php", "--version"] interval: 10s timeout: 5s retries: 5 command: > - sh -c "php artisan migrate --force && php-fpm" + sh -c "sleep 10 && php artisan migrate --force && php-fpm" restart: unless-stopped nginx: diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..e1fec47 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,22 @@ +server { + listen 80; + server_name localhost; + + root /var/www/html/public; + index index.php index.html; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location ~ \.php$ { + fastcgi_pass laravel:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + + location ~ /\.ht { + deny all; + } +}