2026-10-22 07:15:31 -07:00
|
|
|
# Base image. CI passes BASE_IMAGE=httpd@sha256:<digest>, resolved DIRECTLY
|
|
|
|
|
# from Docker Hub in the same run (.gitea/scripts/resolve-base-image.sh), so the
|
|
|
|
|
# pkg-cache registry mirror can only serve content-addressed blobs. Local builds
|
|
|
|
|
# use the tag. Canonical docs: cloud-apache-container docs/pkg-cache.md.
|
|
|
|
|
ARG BASE_IMAGE=httpd:alpine
|
|
|
|
|
FROM ${BASE_IMAGE}
|
2025-07-12 11:03:43 -07:00
|
|
|
|
2025-07-23 19:08:06 -07:00
|
|
|
# Enable .htaccess files by modifying Apache configuration
|
|
|
|
|
RUN sed -i '/<Directory "\/usr\/local\/apache2\/htdocs">/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /usr/local/apache2/conf/httpd.conf
|
|
|
|
|
|
|
|
|
|
# Enable mod_rewrite module (commonly used in .htaccess)
|
|
|
|
|
RUN sed -i 's/#LoadModule rewrite_module/LoadModule rewrite_module/' /usr/local/apache2/conf/httpd.conf
|
|
|
|
|
|
2025-07-12 11:03:43 -07:00
|
|
|
# Copy the default landing page to the container
|
|
|
|
|
COPY index.html /index.html
|
2025-07-12 21:44:24 -07:00
|
|
|
RUN rm -f /usr/local/apache2/htdocs/index.html
|
2025-07-12 11:03:43 -07:00
|
|
|
# Copy the startup script
|
|
|
|
|
COPY scripts/startup.sh /startup.sh
|
|
|
|
|
|
|
|
|
|
# Make the startup script executable
|
|
|
|
|
RUN chmod +x /startup.sh
|
|
|
|
|
|
|
|
|
|
# Set the startup script as the entrypoint
|
|
|
|
|
ENTRYPOINT ["/startup.sh"]
|
|
|
|
|
|