diff --git a/tastyigniter/Dockerfile b/tastyigniter/Dockerfile index bc7f220..1eacc8e 100644 --- a/tastyigniter/Dockerfile +++ b/tastyigniter/Dockerfile @@ -11,15 +11,25 @@ RUN apt-get update && apt-get install -y \ libicu-dev \ zip \ unzip \ - default-mysql-client - -# Clear cache -RUN apt-get clean && rm -rf /var/lib/apt/lists/* + default-mysql-client \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* # Install PHP extensions -RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip xml intl +RUN docker-php-ext-install \ + pdo_mysql \ + mbstring \ + exif \ + pcntl \ + bcmath \ + gd \ + zip \ + xml \ + intl \ + ctype \ + tokenizer -# Get latest Composer +# Install Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # Set working directory diff --git a/tastyigniter/docker-compose.yml b/tastyigniter/docker-compose.yml index afbe0da..24a532b 100644 --- a/tastyigniter/docker-compose.yml +++ b/tastyigniter/docker-compose.yml @@ -13,6 +13,8 @@ services: - APP_KEY= - APP_DEBUG=false - APP_URL=http://localhost + - IGNITER_LOCATION_MODE=multiple + - IGNITER_CARTE_KEY= # Database configuration - DB_CONNECTION=mysql @@ -21,14 +23,19 @@ services: - DB_DATABASE=tastyigniter - DB_USERNAME=tastyigniter - DB_PASSWORD=secret_password + - DB_PREFIX=ti_ - # Admin account - - ADMIN_USER=admin - - ADMIN_EMAIL=admin@example.com - - ADMIN_PASSWORD=admin123 - - # Scheduler and Queue + # Cache and Session + - BROADCAST_DRIVER=log + - CACHE_DRIVER=file - QUEUE_CONNECTION=database + - SESSION_DRIVER=file + - SESSION_LIFETIME=120 + + # Mail Configuration + - MAIL_MAILER=log + - MAIL_FROM_ADDRESS=noreply@tastyigniter.tld + - MAIL_FROM_NAME=TastyIgniter volumes: - tastyigniter:/var/www/html - tastyigniter-storage:/var/www/html/storage @@ -41,8 +48,8 @@ services: image: nginx:alpine container_name: tastyigniter-nginx restart: unless-stopped - # ports: - # - "80:80" + ports: + - "80:80" volumes: - tastyigniter:/var/www/html - ./docker/nginx:/etc/nginx/conf.d diff --git a/tastyigniter/docker/entrypoint.sh b/tastyigniter/docker/entrypoint.sh index d2c0279..f94bb81 100644 --- a/tastyigniter/docker/entrypoint.sh +++ b/tastyigniter/docker/entrypoint.sh @@ -4,9 +4,8 @@ set -e # Check if TastyIgniter is already installed if [ ! -f /var/www/html/composer.json ] || [ ! -d /var/www/html/vendor ]; then echo "Installing TastyIgniter..." - # Create new TastyIgniter project with fallback for handling extension requirements - composer create-project tastyigniter/tastyigniter:^v4.0 /tmp/tastyigniter --prefer-dist --no-interaction --no-progress || \ - composer create-project tastyigniter/tastyigniter:^v4.0 /tmp/tastyigniter --prefer-dist --no-interaction --no-progress --ignore-platform-req=ext-intl + # Create new TastyIgniter project + composer create-project tastyigniter/tastyigniter:^v4.0 /tmp/tastyigniter --prefer-dist --no-interaction --no-progress # Move files to web root cp -a /tmp/tastyigniter/. /var/www/html/ @@ -15,6 +14,11 @@ if [ ! -f /var/www/html/composer.json ] || [ ! -d /var/www/html/vendor ]; then echo "TastyIgniter files installed" fi +# Set proper permissions +chown -R www-data:www-data /var/www/html +chmod -R 755 /var/www/html +chmod -R 775 /var/www/html/storage + # Generate app key if not set if [ -z "$APP_KEY" ]; then php artisan key:generate @@ -27,7 +31,7 @@ while ! mysql -h "$DB_HOST" -u "$DB_USERNAME" -p"$DB_PASSWORD" -e "SELECT 1" >/d done echo "Database connection established" -# Run TastyIgniter installer in non-interactive mode +# Run TastyIgniter installer in non-interactive mode if not installed if [ ! -f .env ] || ! grep -q "IGNITER_INSTALLED=true" .env; then echo "Running TastyIgniter installer..." php artisan igniter:install --no-interaction @@ -40,38 +44,7 @@ else echo "TastyIgniter already installed" fi -# Check for TastyIgniter's .nginx.conf file and copy it if needed -if [ -f /var/www/html/.nginx.conf ]; then - echo "TastyIgniter .nginx.conf found" -else - echo "TastyIgniter .nginx.conf not found, creating a default one" - cat > /var/www/html/.nginx.conf <