From 683fc17608f4779e71aafb8fbabc42964fd8b936 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 29 Jan 2026 08:33:13 +0200 Subject: Add Docker image for f3s deployment Amp-Thread-ID: https://ampcode.com/threads/T-019c086d-c760-779d-b740-0f748094b62a Co-authored-by: Amp --- docker-image/Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 docker-image/Dockerfile (limited to 'docker-image/Dockerfile') diff --git a/docker-image/Dockerfile b/docker-image/Dockerfile new file mode 100644 index 0000000..736f25e --- /dev/null +++ b/docker-image/Dockerfile @@ -0,0 +1,30 @@ +FROM httpd:2.4-alpine + +RUN apk update && apk add --no-cache \ + perl \ + bind-tools \ + && rm -rf /var/cache/apk/* + +# Enable CGI module +RUN sed -i 's/#LoadModule cgid_module/LoadModule cgid_module/' /usr/local/apache2/conf/httpd.conf && \ + sed -i 's/#LoadModule cgi_module/LoadModule cgi_module/' /usr/local/apache2/conf/httpd.conf && \ + echo 'ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"' >> /usr/local/apache2/conf/httpd.conf && \ + echo '' >> /usr/local/apache2/conf/httpd.conf && \ + echo ' AllowOverride None' >> /usr/local/apache2/conf/httpd.conf && \ + echo ' Options +ExecCGI' >> /usr/local/apache2/conf/httpd.conf && \ + echo ' Require all granted' >> /usr/local/apache2/conf/httpd.conf && \ + echo '' >> /usr/local/apache2/conf/httpd.conf && \ + echo 'DirectoryIndex index.pl index.html' >> /usr/local/apache2/conf/httpd.conf && \ + echo 'AddHandler cgi-script .pl' >> /usr/local/apache2/conf/httpd.conf + +# Copy the CGI script +COPY index.pl /usr/local/apache2/cgi-bin/index.pl +RUN chmod 755 /usr/local/apache2/cgi-bin/index.pl + +# Create a redirect from / to /cgi-bin/index.pl +RUN echo '' > /usr/local/apache2/htdocs/index.html + +EXPOSE 80 + +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ + CMD wget -qO- http://127.0.0.1:80/ || exit 1 -- cgit v1.2.3