Add: Volume
This commit is contained in:
parent
848faa0f36
commit
e37dc23961
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
.env
|
||||
data
|
||||
|
14
Dockerfile
14
Dockerfile
@ -22,24 +22,21 @@ RUN usermod -u ${LDAP_USER} openldap && \
|
||||
ADD slapd.sh /opt/slapd
|
||||
RUN /opt/slapd
|
||||
|
||||
COPY ./schema/*.ldif ./schema/*.schema /etc/ldap/schema/
|
||||
|
||||
RUN slapcat -n 0 \
|
||||
|sed 's/cn: config/cn: config\nolcPasswordHash: {CRYPT}\nolcPasswordCryptSaltFormat: $6$%.16s/' \
|
||||
|sed 's/cn: module{0}/cn: module{0}\nolcModuleLoad: {0}lastbind/' > /tmp/config.ldif && \
|
||||
rm -rf /etc/ldap/slapd.d/* && \
|
||||
slapadd -n 0 -F /etc/ldap/slapd.d/ -l /tmp/config.ldif && \
|
||||
echo "dn: olcOverlay={0}lastbind, olcDatabase={1}mdb,cn=config\nobjectClass: olcLastBindConfig\nolcOverlay: {0}lastbind" | slapadd -n 0 && \
|
||||
slapadd -l /etc/ldap/schema/nextcloud.ldif && \
|
||||
rm /tmp/config.ldif
|
||||
|
||||
RUN echo "dn: olcOverlay={0}lastbind, olcDatabase={1}mdb,cn=config\nobjectClass: olcLastBindConfig\nolcOverlay: {0}lastbind" \
|
||||
| slapadd -n 0
|
||||
|
||||
|
||||
COPY ./schema/*.ldif ./schema/*.schema /etc/ldap/schema/
|
||||
|
||||
RUN slapadd -l /etc/ldap/schema/nextcloud.ldif
|
||||
|
||||
RUN chmod -R o+rw /etc/ldap/slapd.d/ && \
|
||||
chmod -R o+rwx /etc/ldap/slapd.d/cn=config/ && \
|
||||
chmod -R o+rwx /etc/ldap/slapd.d/cn=config/cn=schema/ && \
|
||||
chmod -R o+rwx /var/lib/ldap && \
|
||||
chmod -R o+rw /var/run/slapd/
|
||||
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
@ -53,4 +50,3 @@ ENTRYPOINT ["/entrypoint.sh"]
|
||||
EXPOSE 389
|
||||
|
||||
CMD ["/usr/sbin/slapd","-h", "ldap:///","-d","4"]
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
version: "2.4"
|
||||
|
||||
volumes:
|
||||
data:
|
||||
services:
|
||||
admin:
|
||||
image: registry.audio-lab.org/ldapphpadmin
|
||||
@ -19,7 +21,9 @@ services:
|
||||
restart: always
|
||||
ports:
|
||||
- ${LDAP_PORT}:389
|
||||
build:
|
||||
volumes:
|
||||
- data:/var/lib/ldap
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
@ -32,4 +36,3 @@ services:
|
||||
- LDAP_ADMIN_PASSWORD=${LDAP_ADMIN_PASSWORD}
|
||||
- LDAP_ORGANISATION=${LDAP_ORGANISATION}
|
||||
- LDAP_DOMAIN=${LDAP_DOMAIN}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user