# Ultra-minimal Dockerfile for Laravel 5.0 with PHP 5.6 FROM php:5.6-apache # Set working directory WORKDIR /var/www/html # Install packages one by one to identify issues RUN apt-get update # Install core development tools first RUN apt-get install -y \ curl \ git \ zip \ unzip # Install mcrypt (most important for Laravel 5.0) RUN apt-get install -y libmcrypt-dev \ && docker-php-ext-install mcrypt # Install basic PHP extensions RUN docker-php-ext-install \ pdo \ pdo_mysql \ mbstring # Try to install GD dependencies RUN apt-get install -y \ libpng-dev \ libjpeg-dev \ libfreetype6-dev \ && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ && docker-php-ext-install gd # Install zip extension RUN apt-get install -y zlib1g-dev \ && docker-php-ext-install zip # Clean up RUN apt-get clean && rm -rf /var/lib/apt/lists/* # Install Composer RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer # Enable Apache rewrite module RUN a2enmod rewrite # Configure Apache RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf ENV APACHE_DOCUMENT_ROOT=/var/www/html/public RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf # Copy application files COPY . /var/www/html/ # Set basic permissions RUN chown -R www-data:www-data /var/www/html \ && chmod -R 755 /var/www/html # Create .env file if needed RUN if [ ! -f /var/www/html/.env ]; then \ cp /var/www/html/.env.example /var/www/html/.env; \ fi # Install dependencies without dev packages RUN composer install --no-dev --no-interaction || true # Generate Laravel key RUN php artisan key:generate || true # Expose port 80 EXPOSE 80 # Start Apache CMD ["apache2-foreground"]