diff --git a/Dockerfile b/Dockerfile index 0bf470e..293bf32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,28 @@ -FROM php:8.1-fpm +FROM php:8.2-fpm +# Set working directory WORKDIR /var/www/html +# Install system dependencies RUN apt-get update && apt-get install -y \ libpng-dev \ libjpeg-dev \ libfreetype6-dev \ + libzip-dev \ zip \ unzip \ - && docker-php-ext-configure gd \ - && docker-php-ext-install gd pdo pdo_mysql + && docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install gd pdo pdo_mysql bcmath opcache zip +# Copy application files COPY . . -RUN chown -R www-data:www-data /var/www/html +# Set proper permissions +RUN chown -R www-data:www-data /var/www/html \ + && chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache -CMD php artisan migrate --force && php-fpm \ No newline at end of file +# Set entrypoint script +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore old mode 100644 new mode 100755 diff --git a/docker-compose.yml b/docker-compose.yml index 157c6dc..391ead7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,14 +11,14 @@ services: mysql: condition: service_healthy volumes: - - .:/var/www + - .:/var/www/html environment: - DB_HOST=mysql - DB_DATABASE=laravel - DB_USERNAME=root - DB_PASSWORD=root healthcheck: - test: ["CMD", "curl", "-f", "http://localhost"] + test: ["CMD", "php", "-v"] interval: 20s timeout: 10s retries: 5 @@ -35,7 +35,7 @@ services: ports: - "3307:3306" healthcheck: - test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] + test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--password=root"] interval: 10s timeout: 5s retries: 3 @@ -51,7 +51,7 @@ services: condition: service_healthy volumes: - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf - - .:/var/www + - .:/var/www/html ports: - "80:80" networks: diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..8454c07 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# Run migrations +php artisan migrate --force + +# Start PHP-FPM +exec php-fpm \ No newline at end of file diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 3785f6d..0000000 --- a/package-lock.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "laravel", - "lockfileVersion": 3, - "requires": true, - "packages": {} - -} \ No newline at end of file diff --git a/storage/app/.gitignore b/storage/app/.gitignore old mode 100644 new mode 100755 diff --git a/storage/app/private/.gitignore b/storage/app/private/.gitignore old mode 100644 new mode 100755 diff --git a/storage/app/public/.gitignore b/storage/app/public/.gitignore old mode 100644 new mode 100755 diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore old mode 100644 new mode 100755 diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore old mode 100644 new mode 100755 diff --git a/storage/framework/cache/data/.gitignore b/storage/framework/cache/data/.gitignore old mode 100644 new mode 100755 diff --git a/storage/framework/sessions/.gitignore b/storage/framework/sessions/.gitignore old mode 100644 new mode 100755 diff --git a/storage/framework/testing/.gitignore b/storage/framework/testing/.gitignore old mode 100644 new mode 100755 diff --git a/storage/framework/views/.gitignore b/storage/framework/views/.gitignore old mode 100644 new mode 100755 diff --git a/storage/logs/.gitignore b/storage/logs/.gitignore old mode 100644 new mode 100755