Skip to content

Commit 913098d

Browse files
committed
Add ldap PHP module
Allow to authenticate against AD/LDAP. Also fixed previous indentation issues.
1 parent 7ab0fcb commit 913098d

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

Dockerfile

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@ ENV WEB_REPO /var/www/html
77

88
# Install required deb packages
99
RUN apt-get update && apt-get -y upgrade && \
10-
apt-get install -y php-pear php5-curl php5-mysql php5-json php5-gmp php5-mcrypt php5-ldap php5-gd php-net-socket libgmp-dev libmcrypt-dev libpng12-dev && \
10+
apt-get install -y php-pear php5-curl php5-mysql php5-json php5-gmp php5-mcrypt php5-ldap php5-gd php-net-socket libgmp-dev libmcrypt-dev libpng12-dev libldap2-dev && \
1111
rm -rf /var/lib/apt/lists/*
1212

1313
# Configure apache and required PHP modules
1414
RUN docker-php-ext-configure mysqli --with-mysqli=mysqlnd && \
15-
docker-php-ext-install mysqli && \
16-
docker-php-ext-install gd && \
17-
docker-php-ext-install sockets && \
18-
docker-php-ext-install pdo_mysql && \
19-
docker-php-ext-install gettext && \
20-
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h && \
21-
docker-php-ext-configure gmp --with-gmp=/usr/include/x86_64-linux-gnu && \
22-
docker-php-ext-install gmp && \
23-
docker-php-ext-install mcrypt && \
24-
docker-php-ext-install pcntl && \
25-
echo ". /etc/environment" >> /etc/apache2/envvars && \
26-
a2enmod rewrite
15+
docker-php-ext-install mysqli && \
16+
docker-php-ext-install gd && \
17+
docker-php-ext-install sockets && \
18+
docker-php-ext-install pdo_mysql && \
19+
docker-php-ext-install gettext && \
20+
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h && \
21+
docker-php-ext-configure gmp --with-gmp=/usr/include/x86_64-linux-gnu && \
22+
docker-php-ext-install gmp && \
23+
docker-php-ext-install mcrypt && \
24+
docker-php-ext-install pcntl && \
25+
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu && \
26+
docker-php-ext-install ldap && \
27+
echo ". /etc/environment" >> /etc/apache2/envvars && \
28+
a2enmod rewrite
2729

2830
COPY php.ini /usr/local/etc/php/
2931

@@ -33,12 +35,12 @@ RUN tar -xzf /tmp/${PHPIPAM_VERSION}.tar.gz -C ${WEB_REPO}/ --strip-components=1
3335

3436
# Use system environment variables into config.php
3537
RUN cp ${WEB_REPO}/config.dist.php ${WEB_REPO}/config.php && \
36-
sed -i -e "s/\['host'\] = 'localhost'/\['host'\] = 'mysql'/" \
37-
-e "s/\['user'\] = 'phpipam'/\['user'\] = 'root'/" \
38-
-e "s/\['pass'\] = 'phpipamadmin'/\['pass'\] = getenv(\"MYSQL_ENV_MYSQL_ROOT_PASSWORD\")/" \
39-
${WEB_REPO}/config.php && \
40-
sed -i -e "s/\['port'\] = 3306;/\['port'\] = 3306;\n\n\$password_file = getenv(\"MYSQL_ENV_MYSQL_ROOT_PASSWORD\");\nif(file_exists(\$password_file))\n\$db\['pass'\] = preg_replace(\"\/\\\\s+\/\", \"\", file_get_contents(\$password_file));/" \
41-
${WEB_REPO}/config.php
38+
sed -i -e "s/\['host'\] = 'localhost'/\['host'\] = 'mysql'/" \
39+
-e "s/\['user'\] = 'phpipam'/\['user'\] = 'root'/" \
40+
-e "s/\['pass'\] = 'phpipamadmin'/\['pass'\] = getenv(\"MYSQL_ENV_MYSQL_ROOT_PASSWORD\")/" \
41+
${WEB_REPO}/config.php && \
42+
sed -i -e "s/\['port'\] = 3306;/\['port'\] = 3306;\n\n\$password_file = getenv(\"MYSQL_ENV_MYSQL_ROOT_PASSWORD\");\nif(file_exists(\$password_file))\n\$db\['pass'\] = preg_replace(\"\/\\\\s+\/\", \"\", file_get_contents(\$password_file));/" \
43+
${WEB_REPO}/config.php
4244

4345
EXPOSE 80
4446

0 commit comments

Comments
 (0)