diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7b23cd0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM python:2-alpine + +COPY requirements.txt /usr/src/app/ +COPY nginx-ldap-auth-daemon.py /usr/src/app/ + +WORKDIR /usr/src/app/ + +# Install required software +RUN \ + apk --no-cache add openldap-dev && \ + apk --no-cache add --virtual build-dependencies build-base && \ + pip install -r requirements.txt && \ + apk del build-dependencies + + +EXPOSE 8888 + +CMD ["python", "/usr/src/app/nginx-ldap-auth-daemon.py"] diff --git a/README.md b/README.md index d176cf0..a25f501 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,20 @@ To install and configure the reference implementation, perform the following ste 1. To test the reference implementation, use a web browser to access **http://*nginx-server-address*:8081**. Verify that the browser presents a login form. After you fill out the form and submit it, verify that the server returns the expected response to valid credentials. The sample back-end daemon returns this:
Hello, world! Requested URL: URL+ +### Run as Docker container + +Another option to run authentication daemon is [Docker](https://www.docker.com/what-docker) + +1. [Install and run Docker daemon](https://docs.docker.com/engine/getstarted/) + +2. Run following commands to start the ldap-auth daemon in Docker container +
# docker build -t nginx-ldap-auth . +# docker run --name=nginx-ldap-auth --restart=always -d -p 8888:8888 nginx-ldap-auth+ +3. Modify the NGINX Plus configuration file as described in [Required Modifications to the NGINX Plus Configuration File](#required-mods) below. + + ### Required Modifications to the NGINX Plus Configuration File diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..04f438d --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +python-ldap