This commit is contained in:
21
apache/Dockerfile
Normal file
21
apache/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM httpd:2.4-alpine
|
||||
|
||||
# Copy custom httpd.conf if needed (optional)
|
||||
# COPY httpd.conf /usr/local/apache2/conf/httpd.conf
|
||||
|
||||
# Enable Apache modules (rewrite, etc.) if needed
|
||||
RUN sed -i 's/^#\(LoadModule rewrite_module\)/\1/' /usr/local/apache2/conf/httpd.conf && \
|
||||
sed -i 's/^#\(LoadModule deflate_module\)/\1/' /usr/local/apache2/conf/httpd.conf
|
||||
|
||||
# Set document root
|
||||
ENV APACHE_DOCUMENT_ROOT=/var/www/html
|
||||
RUN sed -ri -e 's!/usr/local/apache2/htdocs!${APACHE_DOCUMENT_ROOT}!g' /usr/local/apache2/conf/httpd.conf
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Copy virtual host configuration (will be mounted via docker-compose)
|
||||
# COPY vhosts/ /etc/apache2/sites-enabled/
|
||||
|
||||
# Start Apache in foreground
|
||||
CMD ["httpd-foreground"]
|
||||
12
apache/vhosts/example.conf
Normal file
12
apache/vhosts/example.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
<VirtualHost *:80>
|
||||
ServerName example.local
|
||||
DocumentRoot /var/www/html/example
|
||||
|
||||
<Directory /var/www/html/example>
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/example_error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/example_access.log combined
|
||||
</VirtualHost>
|
||||
Reference in New Issue
Block a user