Skip to content

Commit

Permalink
Removed unofficial phpldapadmin dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Bader committed Jun 9, 2017
1 parent 82e7230 commit 974ee00
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ Letsencrypt cert -> haproxy pem:
cd haproxy/certs
DOMAIN='yourdomain.net' bash -c 'cat /etc/letsencrypt/live/$DOMAIN/fullchain.pem /etc/letsencrypt/live/$DOMAIN/privkey.pem > $DOMAIN.pem'
chmod -R go-rwx .
LDAP user: cn=admin,dc=shib
LDAP pw: toor
40 changes: 33 additions & 7 deletions phpldapadmin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
FROM dinkel/nginx-phpfpm:8.2

MAINTAINER Christian Luginbühl <[email protected]>
FROM debian:jessie

ENV NGINX_VERSION 1.6.2
ENV PHP_VERSION 5.6.30
ENV PHPLDAPADMIN_VERSION 1.2.2

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
phpldapadmin=${PHPLDAPADMIN_VERSION}* && \
ca-certificates \
nginx=${NGINX_VERSION}* \
php5-fpm=${PHP_VERSION}* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN ln -sf /usr/share/phpldapadmin /var/www
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log && \
ln -sf /dev/stderr /var/log/php-fpm.log

RUN rm -rf /var/www/

COPY nginx.conf /etc/nginx/

COPY default.conf /etc/nginx/conf.d/

COPY www.conf /etc/php5/fpm/pool.d/

EXPOSE 80

COPY run.sh /

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
phpldapadmin=${PHPLDAPADMIN_VERSION}* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN ln -sf /usr/share/phpldapadmin /var/www

RUN mv /var/www/config/config.php.example /var/www/config/config.php

Expand All @@ -20,7 +44,9 @@ COPY www.conf /etc/php5/fpm/pool.d/

COPY bootstrap.sh /

RUN chmod +x /run.sh
RUN chmod +x /bootstrap.sh

ENTRYPOINT ["/bootstrap.sh"]

# This script comes from the parent image
CMD ["/run.sh"]
CMD ["/run.sh"]
37 changes: 37 additions & 0 deletions phpldapadmin/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
user www-data;
worker_processes 1;

pid /var/run/nginx.pid;

daemon off;

events {
worker_connections 1024;
}

http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;

include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '[$time_local] "$request" ($remote_addr - $remote_user) '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log warn;

gzip on;
gzip_disable "msie6";

upstream php-handler {
server unix:/var/run/php5-fpm.sock;
}

include /etc/nginx/conf.d/*.conf;
}
27 changes: 27 additions & 0 deletions phpldapadmin/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -m

php5-fpm &
nginx &

pids=`jobs -p`

exitcode=0

function terminate() {
trap "" CHLD

for pid in $pids; do
if ! kill -0 $pid 2>/dev/null; then
wait $pid
exitcode=$?
fi
done

kill $pids 2>/dev/null
}

trap terminate CHLD
wait

exit $exitcode

0 comments on commit 974ee00

Please sign in to comment.