FROM debian:12.6 ARG DEBIAN_FRONTEND=noninteractive # Actualización de sistema RUN apt update -y RUN apt upgrade -y RUN apt install -y dialog apt-utils RUN apt install -y curl unzip wget xz-utils gcc make libapr1-dev libaprutil1-dev libpcre3 libpcre3-dev RUN apt search "Apache Portable Runtime Library" RUN apt search "Apache Portable Runtime Utility " RUN apt install -y libtool libapr1 libaprutil1 libtool-bin # Usuario agregado RUN useradd -m -u 1000 user # USER user # Instalación de Apache WORKDIR /home/user RUN wget https://dlcdn.apache.org/httpd/httpd-2.4.62.tar.gz RUN tar -xf httpd-2.4.62.tar.gz RUN cd httpd-2.4.62 WORKDIR /home/user/httpd-2.4.62 RUN ls -la RUN echo RUN echo =================================================================== RUN cat README RUN echo RUN echo =================================================================== RUN cat README RUN echo RUN echo =================================================================== RUN echo RUN cat INSTALL RUN echo =================================================================== RUN echo RUN ./configure --prefix=/home/user/apache2 --enable-so RUN make RUN make install # $HOME/apache # /apache2/conf/httpd.conf RUN chmod 777 -R /home/user/apache2 RUN ls -la /home/user/apache2/bin RUN sed -i 's/Listen 80/Listen 7860/' /home/user/apache2/conf/httpd.conf RUN cat /home/user/apache2/conf/httpd.conf # RUN /apache2/bin/apachectl start RUN rm -rf /home/user/httpd-2.4.62 USER root RUN apt install -y locate RUN updatedb # USER user RUN ls /home/user/apache2/bin/ -la RUN cp -r /home/user/apache2/bin/ /usr/bin/ RUN ls /usr/bin/ -la USER user RUN /home/user/apache2/bin/apachectl start; /home/user/apache2/bin/apachectl stop; /home/user/apache2/bin/apachectl stop RUN rm /home/user/apache2/htdocs/index.html USER root WORKDIR /home/user RUN apt install -y libxml2 libxml2-dev libsqlite3-dev libssl-dev libz-dev libpng-dev perl pkg-config RUN apt install -y libapache2-mod-php8.2 autoconf automake re2c bison RUN wget https://www.php.net/distributions/php-8.3.12.tar.gz RUN tar -xf php-8.3.12.tar.gz RUN cd php-8.3.12 WORKDIR /home/user/php-8.3.12 RUN ls -la # RUN ./configure --with-apxs2=/home/user/apache2/bin/apxs --with-mysql RUN ./configure --with-apxs2=/home/user/apache2/bin/apxs --with-pdo-mysql RUN make RUN make install RUN apt install -y php-xml php-sqlite3 # USER user RUN sed -i 's/DirectoryIndex index.html/DirectoryIndex index.php index.html/' /home/user/apache2/conf/httpd.conf RUN sed -i 's/#LoadModule rewrite_module modules\/mod_rewrite.so/LoadModule rewrite_module modules\/mod_rewrite.so/' /home/user/apache2/conf/httpd.conf RUN sed -i -z 's/ #\n AllowOverride None/ #\n AllowOverride All/' /home/user/apache2/conf/httpd.conf RUN echo "LoadModule php_module modules/libphp.so" >> /home/user/apache2/conf/httpd.conf RUN echo "" >> /home/user/apache2/conf/httpd.conf RUN echo "" >> /home/user/apache2/conf/httpd.conf RUN echo "SetHandler application/x-httpd-php" >> /home/user/apache2/conf/httpd.conf RUN echo "" >> /home/user/apache2/conf/httpd.conf RUN which php-cgi; # RUN a2enmod php RUN which php RUN updatedb RUN locate default.conf; RUN echo '' >> /etc/apache2/sites-available/000-default.conf RUN echo ' AllowOverride All' >> /etc/apache2/sites-available/000-default.conf RUN echo '' >> /etc/apache2/sites-available/000-default.conf USER user COPY .htaccess /home/user/apache2/htdocs/ COPY app /home/user/apache2/htdocs/app COPY public /home/user/apache2/htdocs/public CMD [ "bash","-c", "cat /home/user/apache2/conf/extra/httpd-default.conf; echo ; echo ; echo ;cat /home/user/apache2/conf/original/extra/httpd-default.conf; echo ; echo ; cat /home/user/apache2/conf/httpd.conf; ls /home/user/apache2/modules ; cat /home/user/apache2/000-default.conf; echo '>>>>>>>>>>>>>>>>>>>> ls -la /home/user/apache2/'; ls -la /home/user/apache2/conf/; ls -la /home/user/apache2/htdocs/; /home/user/apache2/bin/apachectl start; curl localhost:7860; tail -F error.log" ]