diff options
| author | Paul Buetow <paul@buetow.org> | 2026-01-29 08:33:13 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-01-29 08:33:13 +0200 |
| commit | 683fc17608f4779e71aafb8fbabc42964fd8b936 (patch) | |
| tree | 502b7f980978c5b160b85f4e45a9e4f177715211 /docker-image/Dockerfile | |
| parent | e43ba46b7d4e4f0796f94a5394d6a9fdf609482b (diff) | |
Add Docker image for f3s deployment
Amp-Thread-ID: https://ampcode.com/threads/T-019c086d-c760-779d-b740-0f748094b62a
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'docker-image/Dockerfile')
| -rw-r--r-- | docker-image/Dockerfile | 30 |
1 files changed, 30 insertions, 0 deletions
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 '<Directory "/usr/local/apache2/cgi-bin">' >> /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 '</Directory>' >> /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 '<meta http-equiv="refresh" content="0;url=/cgi-bin/index.pl">' > /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 |
