# Use an official PHP 5.6 image with Apache FROM php:5.6-apache # Set the working directory to /var/www/html WORKDIR /var/www/html # Copy composer.lock and composer.json COPY composer.lock composer.json /var/www/html/ # Install dependencies RUN apt-get update && \ apt-get install -y git zip unzip && \ docker-php-ext-install pdo pdo_mysql # Install Composer RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer # Install Laravel dependencies RUN composer install --no-scripts # Copy the rest of the application code COPY . /var/www/html/ # Set permissions RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap # Expose port 80 and start Apache EXPOSE 80 CMD ["apache2-foreground"]