reconfigure
This commit is contained in:
parent
6bc8bfb329
commit
54c1b5554e
|
@ -8,7 +8,8 @@ RUN apt-get update && apt-get install -y \
|
|||
libxml2-dev \
|
||||
zip \
|
||||
unzip \
|
||||
procps
|
||||
procps \
|
||||
mariadb-client
|
||||
|
||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
|
@ -21,7 +22,6 @@ RUN composer install --no-scripts --no-interaction
|
|||
RUN chown -R www-data:www-data /var/www/html
|
||||
RUN chmod -R 775 /var/www/html/storage
|
||||
|
||||
# Install PDO MySQL (Fix for "Could not find driver" error)
|
||||
RUN docker-php-ext-install pdo pdo_mysql
|
||||
|
||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
|
|
|
@ -7,10 +7,10 @@ services:
|
|||
volumes:
|
||||
- mysql-data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-prootpassword"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
retries: 10
|
||||
restart: unless-stopped
|
||||
|
||||
laravel:
|
||||
|
@ -41,7 +41,7 @@ services:
|
|||
laravel:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "8080:80"
|
||||
- "80:80" # Changed from 8080 to 80
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
- ./laravel:/var/www/html
|
||||
|
|
|
@ -1,8 +1,19 @@
|
|||
#!/bin/bash
|
||||
# Fix ownership and permissions for storage directories
|
||||
set -e
|
||||
|
||||
# Fix ownership and permissions
|
||||
chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
|
||||
chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
|
||||
|
||||
# Wait for MySQL to be ready
|
||||
echo "Waiting for MySQL to be ready..."
|
||||
while ! mysqladmin ping -h"mysql" -u"root" -p"rootpassword" --silent; do
|
||||
sleep 1
|
||||
done
|
||||
echo "MySQL is ready!"
|
||||
|
||||
# Run migrations
|
||||
php artisan migrate --force
|
||||
|
||||
# Start PHP-FPM
|
||||
exec "$@"
|
||||
|
|
Loading…
Reference in New Issue