diff --git a/Dockerfile b/Dockerfile index 8a08879..7b06f11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,46 +1,41 @@ -# Use the official PHP image based on Alpine Linux -FROM php:5.6-fpm-alpine +# Use an official PHP 5.6 Apache image +FROM php:5.6-apache -# Install system dependencies and PHP extensions -RUN apk --update --no-cache add \ - nginx \ - libpng-dev \ - libjpeg-turbo-dev \ - freetype-dev \ - libzip-dev \ - zip \ - unzip \ - libmcrypt-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install gd pdo pdo_mysql zip mcrypt +# Set the working directory inside the container +WORKDIR /var/www/html -# Set the working directory in the container -WORKDIR /var/www +# Install required dependencies +RUN apt-get update && \ + apt-get install -y \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libpng12-dev \ + libmcrypt-dev \ + libzip-dev \ + unzip \ + git \ + curl -# Clear cache -# RUN apt-get clean && rm -rf /var/lib/apt/lists/* - -# Copy the Laravel application files to the container -COPY . . - -# Set appropriate permissions for Laravel storage and bootstrap cache -RUN chown -R www-data:www-data storage bootstrap - -# Install Composer +# Install Composer globally RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +# Enable required PHP extensions +RUN docker-php-ext-install pdo_mysql mbstring zip mcrypt + +# Enable Apache modules +RUN a2enmod rewrite + +# Copy the Laravel application files into the container +COPY . . + # Install Laravel dependencies -RUN composer install --no-plugins --no-scripts +RUN composer install --no-interaction --optimize-autoloader -# Generate Laravel application key -RUN php artisan key:generate +# Set permissions +RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap -# Create directory for the socket and set permissions -RUN mkdir -p /run/php && chown www-data:www-data /run/php +# Expose port 80 +EXPOSE 80 -# Copy the www.conf file to PHP-FPM pool.d directory -# COPY www.conf /usr/local/etc/php-fpm.d/www.conf - -# Expose port 9000 and start php-fpm server -EXPOSE 9000 -CMD ["php-fpm"] \ No newline at end of file +# Start the Apache server +CMD ["apache2-foreground"] diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 7975ccf..31d0aa8 100755 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -67,18 +67,24 @@