FROM mariadb:10.3.39 ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Asia/Muscat ENV HOME=/home/user RUN apt-get update && \ apt-get install -y --no-install-recommends \ tzdata \ p7zip-full \ apache2 \ libapache2-mod-php \ php-mysql \ curl \ ca-certificates \ unzip \ gnupg \ p7zip-full && \ rm -rf /var/lib/apt/lists/* && \ useradd -m -u 1000 user # ---- Install Node.js ---- RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ apt-get update && \ apt-get install -y --no-install-recommends nodejs && \ rm -rf /var/lib/apt/lists/* && \ npm config set engine-strict false && \ npm config set fund false && \ npm config set audit false WORKDIR /home/user/app # Copy encrypted archive only COPY --chown=user htdocs.7z /home/user/app/htdocs.7z # Import SQL (executed at first init in start.sh) COPY --chown=user wallacepos.sql /home/user/app/wallacepos.sql # Adminer RUN mkdir -p /home/user/app/htdocs && \ curl -fsSL -o /home/user/app/adminer.php https://www.adminer.org/latest-mysql.php # Apache modules RUN a2enmod rewrite headers proxy proxy_http proxy_wstunnel # Reverse proxy rules COPY wpos-proxy.conf /etc/apache2/conf-available/wpos-proxy.conf RUN a2enconf wpos-proxy # Hugging Face exposed port RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf && \ sed -i 's/:80/:7860/g' /etc/apache2/sites-available/000-default.conf # DocumentRoot -> htdocs RUN sed -i 's#DocumentRoot .*#DocumentRoot /home/user/app/htdocs#' /etc/apache2/sites-available/000-default.conf # Allow .htaccess in your app RUN printf '%s\n' \ '' \ ' Options FollowSymLinks' \ ' AllowOverride All' \ ' Require all granted' \ ' DirectoryIndex index.php index.html' \ '' \ > /etc/apache2/conf-available/app-docroot.conf && \ a2enconf app-docroot COPY --chown=user start.sh /home/user/app/start.sh RUN chmod +x /home/user/app/start.sh EXPOSE 7860 ENTRYPOINT ["/home/user/app/start.sh"]