FROM httpd:2.4
# Enable modules
RUN sed -i \
-e 's/^#LoadModule rewrite_module/LoadModule rewrite_module/' \
-e 's/^#LoadModule headers_module/LoadModule headers_module/' \
-e 's/^#LoadModule autoindex_module/LoadModule autoindex_module/' \
-e 's/^#LoadModule alias_module/LoadModule alias_module/' \
/usr/local/apache2/conf/httpd.conf
# Configure autoindex + icons + .htaccess + ignore "_" entries + UTF-8
RUN printf '\n# --- Custom for file listing + .htaccess ---\n\
AddDefaultCharset UTF-8\n\
\n\
Include conf/extra/httpd-autoindex.conf\n\
\n\
Alias /icons/ "/usr/local/apache2/icons/"\n\
\n\
Require all granted\n\
\n\
\n\
# Autoindex settings\n\
IndexOptions FancyIndexing FoldersFirst NameWidth=*\n\
\n\
\n\
Options Indexes FollowSymLinks\n\
IndexIgnore _*\n\
AllowOverride All\n\
Require all granted\n\
\n' >> /usr/local/apache2/conf/httpd.conf
# Force download for shared files
RUN printf '\n# --- Force download in _share ---\n\
\n\
# Header set Content-Disposition "attachment"\n\
# We want to let the application handle the download name if possible\n\
# or just serve it directly if accessed directly. \n\
# Actually, we should probably proxy requests for metadata resolution\n\
# But for now, let''s just keep it simple. \n\
# If we want Apache to serve it with original name, we need a map.\n\
# Since we moved logic to Node, Apache just serves raw files if needed.\n\
\n' >> /usr/local/apache2/conf/httpd.conf
EXPOSE 80