|
| 1 | +FROM python:2-alpine |
| 2 | + |
| 3 | +WORKDIR /usr/src/app/ |
| 4 | +COPY nginx-ldap-auth-daemon.py /usr/src/app/ |
| 5 | + |
| 6 | +WORKDIR /tests |
| 7 | +COPY t/ldap-auth.t /tests |
| 8 | +COPY t/runtests.sh /tests |
| 9 | + |
| 10 | +# Install required software |
| 11 | +RUN \ |
| 12 | + apk --no-cache add openldap-dev && \ |
| 13 | + apk --no-cache add openldap && \ |
| 14 | + apk --no-cache add openldap-back-hdb && \ |
| 15 | + apk --no-cache add openldap-clients && \ |
| 16 | + apk --no-cache add openssl && \ |
| 17 | + apk --no-cache add nginx && \ |
| 18 | + apk --no-cache add nginx-mod-http-geoip && \ |
| 19 | + apk --no-cache add nginx-mod-stream-geoip && \ |
| 20 | + apk --no-cache add nginx-mod-http-image-filter && \ |
| 21 | + apk --no-cache add nginx-mod-stream && \ |
| 22 | + apk --no-cache add nginx-mod-mail && \ |
| 23 | + apk --no-cache add nginx-mod-http-perl && \ |
| 24 | + apk --no-cache add nginx-mod-http-xslt-filter && \ |
| 25 | + apk --no-cache add mercurial && \ |
| 26 | + apk --no-cache add perl && \ |
| 27 | + apk --no-cache add --virtual build-dependencies build-base && \ |
| 28 | + pip install python-ldap && \ |
| 29 | + pip install coverage && \ |
| 30 | + apk del build-dependencies |
| 31 | + |
| 32 | + |
| 33 | +# Install tests |
| 34 | +RUN \ |
| 35 | + cd /tests && \ |
| 36 | + hg clone https://hg.nginx.org/nginx-tests && \ |
| 37 | + mv ldap-auth.t nginx-tests |
| 38 | + |
| 39 | +WORKDIR /usr/src/app/ |
| 40 | + |
| 41 | +ENV TEST_LDAP_DAEMON=/usr/sbin/slapd |
| 42 | +ENV TEST_LDAP_AUTH_DAEMON=/usr/src/app/nginx-ldap-auth-daemon.py |
| 43 | +ENV TEST_NGINX_BINARY=/usr/sbin/nginx |
| 44 | +ENV TEST_NGINX_MODULES=/usr/lib/nginx/modules |
| 45 | +ENV LDAPTLS_REQCERT=never |
| 46 | + |
| 47 | +WORKDIR /tests/nginx-tests |
| 48 | + |
| 49 | +CMD ["/tests/runtests.sh"] |
0 commit comments