FROM httpd:2.4.63-alpine

# Enable the modules PHP-FPM proxying and Laravel's pretty URLs need.
RUN sed -i \
        -e 's/^#LoadModule proxy_module/LoadModule proxy_module/' \
        -e 's/^#LoadModule proxy_fcgi_module/LoadModule proxy_fcgi_module/' \
        -e 's/^#LoadModule rewrite_module/LoadModule rewrite_module/' \
        -e 's#DocumentRoot "/usr/local/apache2/htdocs"#DocumentRoot "/var/www/html/public"#' \
        -e 's#<Directory "/usr/local/apache2/htdocs">#<Directory "/var/www/html/public">#' \
        -e 's/DirectoryIndex index.html/DirectoryIndex index.php index.html/' \
        conf/httpd.conf \
    && echo 'Include conf/extra/laravel.conf' >> conf/httpd.conf

COPY laravel.conf /usr/local/apache2/conf/extra/laravel.conf
