-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
130 lines (118 loc) · 3.39 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
version: "3.7"
services:
ol:
image: osixia/openldap:latest
ports:
- "389:389"
- "636:636"
env_file:
- ./ldap.env
volumes:
- ./data/ldif:/data/ldif
command: --loglevel debug
networks:
- redis-network
ol-verify:
image: python:slim-buster
volumes:
- ./verify_user.py:/verify_user.py
profiles:
- verify
stdin_open: true
tty: true
environment:
- PYTHONUNBUFFERED=1
command:
- bash
- -c
- |
apt -qq update && apt -qq install -y gcc libsasl2-dev libldap2-dev libssl-dev
pip --disable-pip-version-check install prompt_toolkit python-ldap --quiet
python3 /verify_user.py
depends_on:
- ol
networks:
- redis-network
ol-seed:
image: alpine
volumes:
- ./data/ldif:/data/ldif
networks:
- redis-network
depends_on:
- ol
command:
- sh
- -c
- |
apk add openldap-clients
echo "Seeding ol db...."
sleep 3
ldapadd -a -x -H "ldap://ol:389" -D "cn=admin,dc=ldap-demo,dc=test" -f /data/ldif/overlay.ldif -w ldap123 -c
ldapadd -a -x -H "ldap://ol:389" -D "cn=admin,dc=ldap-demo,dc=test" -f /data/ldif/referential.ldif -w ldap123 -c
ldapmodify -a -x -H "ldap://ol:389" -D "cn=admin,dc=ldap-demo,dc=test" -f /data/ldif/setupdb.ldif -w ldap123 -c
ldapmodify -a -x -H "ldap://ol:389" -D "cn=admin,dc=ldap-demo,dc=test" -f /data/ldif/groups.ldif -w ldap123 -c
ldapmodify -a -x -H "ldap://ol:389" -D "cn=admin,dc=ldap-demo,dc=test" -f /data/ldif/users.ldif -w ldap123 -c
ldapmodify -a -x -H "ldap://ol:389" -D "cn=admin,dc=ldap-demo,dc=test" -f /data/ldif/index.ldif -w ldap123 -c
nginx-ldap-auth:
image: bitnami/nginx-ldap-auth-daemon-archived
ports:
- 8888:8888
depends_on:
- ol
networks:
- redis-network
nginx-ldap:
image: nginx
volumes:
- ./nginx-ldap.conf.template:/etc/nginx/templates/nginx-ldap.conf.template
ports:
- "${NGINX_PORT:-12000}:${NGINX_PORT:-12000}"
environment:
- FORWARD_HOST=redisinsight
- FORWARD_PORT=${RIPORT:-5540}
- NGINX_PORT=${NGINX_PORT:-12000}
depends_on:
- redisinsight
- ol
networks:
- redis-network
redis-stack:
image: redis/redis-stack-server
networks:
- redis-network
#ad:
# container_name: ad
# image: dwimberger/ldap-ad-it
# ports:
# - "10389:10389"
# volumes:
# - "./data/ldif/ad.ldif:/ldap/users.ldif"
redisinsight:
image: redis/redisinsight
environment:
- RIPORT=${RIPORT:-5540}
depends_on:
- redis-stack
networks:
- redis-network
# redisinsight-redis-setup:
# image: alpine
# environment:
# - RIPORT=${RIPORT:-8001}
# command:
# - sh
# - -c
# - |
# apk add curl
# echo "Adding redis-stack...."
# wget -qO- https://raw.githubusercontent.com/eficode/wait-for/v2.2.3/wait-for | sh -s -- redisinsight:$$RIPORT -- echo Redisinsight is up
# curl -s -X "POST" "http://redisinsight:$$RIPORT/api/instance/" -H "Content-Type: application/json; charset=utf-8" -d '{"host": "redis-stack","name": "redis-stack","connectionType": "STANDALONE","port": 6379}'
# networks:
# - redis-network
# depends_on:
# - redisinsight
# - redis-stack
networks:
redis-network:
driver: bridge