Add mod_rewrite to Docker image httpd:alpine
mod_rewrite
is installed by default with apache in alpine, so no need to install it again. So here's how you enable mod_rewrite
in Alpine:
FROM httpd:alpine
# Copy .htaccess into DocumentRoot
COPY ./.htaccess /var/www/html/
RUN sed -i '/LoadModule rewrite_module/s/^#//g' /usr/local/apache2/conf/httpd.conf
RUN { \
echo 'IncludeOptional conf.d/*.conf'; \
} >> /usr/local/apache2/conf/httpd.conf \
&& mkdir /usr/local/apache2/conf.d