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