This works
This commit is contained in:
38
Dockerfile
38
Dockerfile
@ -1,32 +1,36 @@
|
||||
# Dockerfile
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# 1) Install Supervisor, slapd, ldap-utils, Apache2+PHP, wget, unzip, envsubst
|
||||
# 1) Install Supervisor, slapd, ldap-utils, Apache2+PHP, wget, bzip2, envsubst, and CA certificates
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
supervisor \
|
||||
slapd ldap-utils \
|
||||
wget unzip gnupg \
|
||||
wget bzip2 \
|
||||
apache2 libapache2-mod-php php php-ldap php-mbstring php-xml \
|
||||
gettext-base \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 2) Download and install Hydra binary (v2.3.0) using the precise URL
|
||||
# 2) Download and install Hydra binary (v2.3.0)
|
||||
RUN wget -qO /tmp/hydra.tar.gz \
|
||||
https://github.com/ory/hydra/releases/download/v2.3.0/hydra_2.3.0-linux_64bit.tar.gz && \
|
||||
mkdir -p /usr/local/bin/hydra_tmp && \
|
||||
tar -xzf /tmp/hydra.tar.gz -C /usr/local/bin/hydra_tmp && \
|
||||
mv /usr/local/bin/hydra_tmp/hydra /usr/local/bin/hydra && \
|
||||
mkdir -p /tmp/hydra_tmp && \
|
||||
tar -xzf /tmp/hydra.tar.gz -C /tmp/hydra_tmp && \
|
||||
mv "$(find /tmp/hydra_tmp -type f -name hydra)" /usr/local/bin/hydra && \
|
||||
chmod +x /usr/local/bin/hydra && \
|
||||
rm -rf /usr/local/bin/hydra_tmp /tmp/hydra.tar.gz
|
||||
rm -rf /tmp/hydra.tar.gz /tmp/hydra_tmp
|
||||
|
||||
# 3) Install LAM (osixia/ldap-account-manager) under /var/www/lam
|
||||
RUN LAM_VERSION=1.2.1 && \
|
||||
wget -qO /tmp/lam.zip https://github.com/osixia/ldap-account-manager/releases/download/${LAM_VERSION}/ldap-account-manager_${LAM_VERSION}.zip && \
|
||||
unzip /tmp/lam.zip -d /var/www/html && \
|
||||
mv /var/www/html/ldap-account-manager /var/www/html/lam && \
|
||||
rm /tmp/lam.zip
|
||||
# 3) Install LAM (LDAP Account Manager) v9.2 under /var/www/html/lam
|
||||
RUN wget -qO /tmp/lam.tar.bz2 \
|
||||
https://github.com/LDAPAccountManager/lam/releases/download/9.2/ldap-account-manager-9.2.tar.bz2 && \
|
||||
mkdir -p /tmp/lam_tmp && \
|
||||
tar -xjf /tmp/lam.tar.bz2 -C /tmp/lam_tmp && \
|
||||
mv /tmp/lam_tmp/ldap-account-manager-9.2 /var/www/html/lam && \
|
||||
rm -rf /tmp/lam.tar.bz2 /tmp/lam_tmp
|
||||
|
||||
# 4) Enable Apache modules required by LAM
|
||||
RUN a2enmod php8.2 ldap rewrite
|
||||
@ -39,12 +43,12 @@ RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||
# 6) Copy all template files into /templates
|
||||
COPY templates/ /templates/
|
||||
|
||||
# 7) Create empty folder for LAM config (will be filled at runtime)
|
||||
RUN mkdir -p /var/www/lam/config
|
||||
RUN chown -R www-data:www-data /var/www/lam
|
||||
# 7) Create empty folder for LAM runtime config (populated via entrypoint.sh)
|
||||
RUN mkdir -p /var/www/html/lam/config
|
||||
RUN chown -R www-data:www-data /var/www/html/lam
|
||||
|
||||
# 8) Expose ports: LDAP=389, LDAPS=636, Hydra Public=4444, Hydra Admin=4445, HTTP=80
|
||||
EXPOSE 389 636 4444 4445 80
|
||||
|
||||
# 9) At runtime, entrypoint.sh does all the envsubst + slapd reconfiguration + supervisord
|
||||
# 9) At runtime, entrypoint.sh does envsubst + slapd reconfiguration + supervisord
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
|
Reference in New Issue
Block a user