Upload files to "/"

This commit is contained in:
Marisa 2025-11-30 10:15:02 -05:00
parent 026b02aa51
commit e72c842b43
2 changed files with 38 additions and 4 deletions

View File

@ -11,6 +11,25 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
slapd ldap-utils gnutls-bin ssl-cert ca-certificates schema2ldif vim mc && apt-get clean
# ──────────────────────────────────────────────────────────────
# APACHE + PHP + everything phpLDAPadmin needs
# ──────────────────────────────────────────────────────────────
RUN apt-get update && apt-get install -y --no-install-recommends \
apache2 \
php libapache2-mod-php \
php-ldap php-mbstring php-xml php-curl php-intl wget \
&& rm -rf /var/lib/apt/lists/*
# Enable required Apache modules
RUN a2enmod rewrite headers ssl
# Use mpm_prefork (required for PHP)
RUN a2dismod mpm_event && a2enmod mpm_prefork
# Clean up default Apache site
RUN rm -rf /var/www/html/* && \
echo "<?php phpinfo(); ?>" > /var/www/html/info.php
# preconfigure slapd installation without using systemd
RUN echo "slapd slapd/password1 password admin" | debconf-set-selections && \
echo "slapd slapd/password2 password admin" | debconf-set-selections && \

View File

@ -144,10 +144,25 @@ fi
kill $SLAPD_PID 2>/dev/null || true
wait $SLAPD_PID 2>/dev/null || true
# Final strict slapd + keep interactive shell (THE CORRECT WAY)
echo "--> Starting final strict slapd — you keep your shell"
# Start OpenLDAP in background
echo "--> Starting final OpenLDAP (background)"
slapd -h "ldap:/// ldaps:/// ldapi:///" -u openldap -g openldap -d 0 &
SLAPD_PID=$!
echo "--> ldapdock ready — marisa password = MarisaNewPass2025"
export LDAPTLS_REQCERT=allow
# Start Apache in background
echo "--> Starting Apache + PHP (background)"
apache2ctl -D FOREGROUND &
APACHE_PID=$!
# Victory message
echo "--> ldapdock ready — OpenLDAP + Apache + PHP running"
echo " → LDAP: 389/636"
echo " → Web: http://localhost/info.php"
echo " → Shell: you are here forever"
echo " → Stop with Ctrl+C"
# THIS IS THE MAGIC LINE — explained below
trap 'echo "Stopping services..."; kill $SLAPD_PID $APACHE_PID 2>/dev/null; wait' SIGINT SIGTERM
# Give you your interactive shell — forever
exec "$@"