See https://betterprogramming.pub/ldap-docker-image-with-populated-users-3a5b4d090aa4
Last active
May 30, 2023 12:17
-
-
Save LukasForst/e60b65d505a4f8e6ce515d4397996b3a to your computer and use it in GitHub Desktop.
LDAP in docker container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dn: ou=groups,dc=slp,dc=mild,dc=blue | |
objectclass: top | |
objectclass: organizationalUnit | |
ou: groups | |
dn: ou=subgroups,ou=groups,dc=slp,dc=mild,dc=blue | |
objectclass: top | |
objectclass: organizationalUnit | |
ou: subgroups | |
dn: ou=people,dc=slp,dc=mild,dc=blue | |
objectclass: top | |
objectclass: organizationalUnit | |
ou: people | |
dn: ou=otherpeople,dc=slp,dc=mild,dc=blue | |
objectclass: top | |
objectclass: organizationalUnit | |
ou: otherpeople | |
dn: uid=ben,ou=people,dc=slp,dc=mild,dc=blue | |
objectclass: top | |
objectclass: person | |
objectclass: organizationalPerson | |
objectclass: inetOrgPerson | |
cn: Ben | |
sn: Alex (manager) | |
uid: ben | |
userPassword: benspassword | |
dn: uid=bob,ou=people,dc=slp,dc=mild,dc=blue | |
objectclass: top | |
objectclass: person | |
objectclass: organizationalPerson | |
objectclass: inetOrgPerson | |
cn: Bob | |
sn: Hamilton (developer) | |
uid: bob | |
userPassword: bobspassword | |
dn: cn=developers,ou=groups,dc=slp,dc=mild,dc=blue | |
objectclass: top | |
objectclass: groupOfUniqueNames | |
cn: developers | |
ou: developer | |
uniqueMember: uid=ben,ou=people,dc=slp,dc=mild,dc=blue | |
dn: cn=managers,ou=groups,dc=slp,dc=mild,dc=blue | |
objectclass: top | |
objectclass: groupOfUniqueNames | |
cn: managers | |
ou: manager | |
uniqueMember: uid=ben,ou=people,dc=springframework,dc=org | |
dn: cn=submanagers,ou=subgroups,ou=groups,dc=slp,dc=mild,dc=blue | |
objectclass: top | |
objectclass: groupOfUniqueNames | |
cn: submanagers | |
ou: submanager | |
uniqueMember: uid=ben,ou=people,dc=slp,dc=mild,dc=blue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
server: | |
image: 862258098890.dkr.ecr.eu-west-1.amazonaws.com/common-slp-euw1-authentik | |
command: server | |
environment: | |
- AUTHENTIK_REDIS__HOST=redis | |
- AUTHENTIK_POSTGRESQL__HOST=postgresql | |
- AUTHENTIK_POSTGRESQL__USER=authentik | |
- AUTHENTIK_POSTGRESQL__NAME=authentik | |
- AUTHENTIK_POSTGRESQL__PASSWORD=authentik | |
- AUTHENTIK_ERROR_REPORTING__ENABLED=true | |
- AUTHENTIK_SECRET_KEY=iO6XOk2wSIa5Q3bWt7G4263LqTlCKu4o | |
ports: | |
- "9000:9000" | |
depends_on: | |
- worker | |
- postgresql | |
- redis | |
worker: | |
image: ghcr.io/goauthentik/server:2023.3.1 | |
command: worker | |
environment: | |
- AUTHENTIK_REDIS__HOST=redis | |
- AUTHENTIK_POSTGRESQL__HOST=postgresql | |
- AUTHENTIK_POSTGRESQL__USER=authentik | |
- AUTHENTIK_POSTGRESQL__NAME=authentik | |
- AUTHENTIK_POSTGRESQL__PASSWORD=authentik | |
- AUTHENTIK_ERROR_REPORTING__ENABLED=true | |
- AUTHENTIK_SECRET_KEY=iO6XOk2wSIa5Q3bWt7G4263LqTlCKu4o | |
user: root | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
postgresql: | |
image: postgres:12-alpine | |
healthcheck: | |
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ] | |
start_period: 20s | |
interval: 30s | |
retries: 5 | |
timeout: 5s | |
volumes: | |
- database:/var/lib/postgresql/data | |
environment: | |
- POSTGRES_PASSWORD=authentik | |
- POSTGRES_USER=authentik | |
- POSTGRES_DB=authentik | |
redis: | |
image: redis:alpine | |
healthcheck: | |
test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ] | |
start_period: 20s | |
interval: 30s | |
retries: 5 | |
timeout: 3s | |
ldap: | |
image: ldap | |
build: | |
context: . | |
dockerfile: Dockerfile.ldap | |
container_name: ldap | |
environment: | |
LDAP_ADMIN_PASSWORD: MyActiveDirectoryPass12. | |
LDAP_BASE_DN: dc=slp,dc=mild,dc=blue | |
ports: | |
- "389:389" | |
admin: | |
image: osixia/phpldapadmin:0.9.0 | |
container_name: admin | |
environment: | |
PHPLDAPADMIN_LDAP_HOSTS: ldap | |
PHPLDAPADMIN_HTTPS: 'false' | |
ports: | |
- "8080:80" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM osixia/openldap | |
ENV LDAP_ORGANISATION="Mild Blue" | |
ENV LDAP_DOMAIN="slp.mild.blue" | |
COPY bootstrap.ldif /container/service/slapd/assets/config/bootstrap/ldif/50-bootstrap.ldif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment