# Bare minimum working Dockerfile for Laravel 5.0 FROM php:5.6-apache WORKDIR /var/www/html # Install absolute essentials only RUN apt-get update \ && apt-get install -y \ curl \ git \ libmcrypt-dev \ && docker-php-ext-install \ pdo \ pdo_mysql \ mcrypt \ && 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 RUN a2enmod rewrite # Configure Apache for Laravel 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 app and set permissions COPY . /var/www/html/ RUN chown -R www-data:www-data /var/www/html # Basic Laravel setup RUN if [ ! -f .env ]; then cp .env.example .env; fi RUN composer install --no-dev --no-interaction --ignore-platform-reqs RUN php artisan key:generate || true EXPOSE 80 CMD ["apache2-foreground"]