Upload files to "/"
This commit is contained in:
parent
026b02aa51
commit
e72c842b43
19
dockerfile
19
dockerfile
@ -11,6 +11,25 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
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
|
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
|
# preconfigure slapd installation without using systemd
|
||||||
RUN echo "slapd slapd/password1 password admin" | debconf-set-selections && \
|
RUN echo "slapd slapd/password1 password admin" | debconf-set-selections && \
|
||||||
echo "slapd slapd/password2 password admin" | debconf-set-selections && \
|
echo "slapd slapd/password2 password admin" | debconf-set-selections && \
|
||||||
|
|||||||
@ -144,10 +144,25 @@ fi
|
|||||||
kill $SLAPD_PID 2>/dev/null || true
|
kill $SLAPD_PID 2>/dev/null || true
|
||||||
wait $SLAPD_PID 2>/dev/null || true
|
wait $SLAPD_PID 2>/dev/null || true
|
||||||
|
|
||||||
# Final strict slapd + keep interactive shell (THE CORRECT WAY)
|
# Start OpenLDAP in background
|
||||||
echo "--> Starting final strict slapd — you keep your shell"
|
echo "--> Starting final OpenLDAP (background)"
|
||||||
slapd -h "ldap:/// ldaps:/// ldapi:///" -u openldap -g openldap -d 0 &
|
slapd -h "ldap:/// ldaps:/// ldapi:///" -u openldap -g openldap -d 0 &
|
||||||
|
SLAPD_PID=$!
|
||||||
|
|
||||||
echo "--> ldapdock ready — marisa password = MarisaNewPass2025"
|
# Start Apache in background
|
||||||
export LDAPTLS_REQCERT=allow
|
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 "$@"
|
exec "$@"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user