From 5f226a38416bb6f80ebf3671e44529fef9911ec1 Mon Sep 17 00:00:00 2001 From: Gabriel Carneiro Date: Thu, 27 Feb 2025 10:44:21 -0300 Subject: [PATCH] add dockerfile --- image/Dockerfile | 45 +++++++++++++++++++++++++++++++++++++++++++++ image/userdir.conf | 14 ++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 image/Dockerfile create mode 100644 image/userdir.conf diff --git a/image/Dockerfile b/image/Dockerfile new file mode 100644 index 0000000..0ac856d --- /dev/null +++ b/image/Dockerfile @@ -0,0 +1,45 @@ +FROM ubuntu:latest + +RUN apt-get update && apt-get install -y \ + apache2 \ + php \ + php-mysql \ + php-ldap \ + libapache2-mod-php \ + libapache2-mod-xsendfile \ + ca-certificates \ + git \ + openssl \ + sssd \ + ldap-utils \ + ffmpeg \ + curl \ + && apt-get clean + +RUN update-ca-certificates + +# enable userdir and ldap modules +RUN a2enmod userdir +RUN a2enmod authnz_ldap + +# Enable file uploads and configure PHP settings +RUN sed -i "s/^\(file_uploads\s*=\s*\)Off/\1On/" /etc/php/8.3/apache2/php.ini \ + && sed -i "s/^\(upload_max_filesize\s*=\s*\)[0-9]\+/upload_max_filesize = 500M/" /etc/php/8.3/apache2/php.ini \ + && sed -i "s/^\(post_max_size\s*=\s*\)[0-9]\+/post_max_size = 500M/" /etc/php/8.3/apache2/php.ini + +COPY userdir.conf /etc/apache2/mods-available/userdir.conf + +# change apache log level +RUN sed -i '/^LogLevel /s/ .*/ debug/' /etc/apache2/apache2.conf + +# disable sss in nsswitch.conf +RUN sed -i 's/sss//g' /etc/nsswitch.conf + +# enable sss in nsswitch.conf for passwd, group and shadow +RUN sed -i '/^\(\passwd\|group\|hosts\|shadow\)/s/$/ sss/' /etc/nsswitch.conf + +# Expose the HTTP port +EXPOSE 80 + +# Start Apache in the foreground +CMD ["apachectl", "-D", "FOREGROUND"] diff --git a/image/userdir.conf b/image/userdir.conf new file mode 100644 index 0000000..dc24f79 --- /dev/null +++ b/image/userdir.conf @@ -0,0 +1,14 @@ +UserDir public_html +UserDir disabled root + + + AllowOverride FileInfo AuthConfig Limit Indexes + Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec + Require method GET POST OPTIONS + + + + AllowOverride FileInfo AuthConfig Limit Indexes + Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec + Require method GET POST OPTIONS +