1- # Lab 05 — Advanced Integration: nextcloud with full IT-Stack ecosystem
2- ---
1+ # docker-compose.integration.yml -- Lab 05: Advanced Integration
2+ # Nextcloud + OpenLDAP (FreeIPA sim) + PostgreSQL + Redis + Keycloak
3+ # Lab 05 tests: LDAP user auth, OIDC SSO, Redis sessions, cron worker, WebDAV
4+ #
5+ # Ports:
6+ # 8100 -- Nextcloud HTTP
7+ # 8104 -- Keycloak admin console
8+ # 3890 -- OpenLDAP
9+ #
10+ # Credentials:
11+ # LDAP admin: cn=admin,dc=lab,dc=local / LdapAdmin05!
12+ # LDAP readonly: cn=readonly,dc=lab,dc=local / ReadOnly05!
13+ # DB: nextcloud / Lab05Password!
14+ # Redis: Lab05Redis!
15+ # Keycloak: admin / Lab05Admin!
16+ # OIDC secret: nextcloud-secret-05
17+
18+ x-nc-int-env : &nc-int-env
19+ POSTGRES_HOST : nc-int-db
20+ POSTGRES_DB : nextcloud
21+ POSTGRES_USER : nextcloud
22+ POSTGRES_PASSWORD : Lab05Password!
23+ REDIS_HOST : nc-int-redis
24+ REDIS_HOST_PASSWORD : Lab05Redis!
25+ NEXTCLOUD_TRUSTED_DOMAINS : " localhost nc-int-app"
26+ NC_oidc_login_provider_url : http://nc-int-keycloak:8080/realms/it-stack
27+ NC_oidc_login_client_id : nextcloud
28+ NC_oidc_login_client_secret : nextcloud-secret-05
29+ NC_oidc_login_button_text : Login with Keycloak
30+ NC_oidc_login_auto_redirect : " false"
31+ LDAP_PROVIDER_HOST : nc-int-ldap
32+ LDAP_PROVIDER_PORT : " 389"
33+ LDAP_PROVIDER_BINDDN : " cn=readonly,dc=lab,dc=local"
34+ LDAP_PROVIDER_BINDPASS : ReadOnly05!
35+ LDAP_PROVIDER_BASEDN : " dc=lab,dc=local"
36+
337services :
4- nextcloud :
5- image : nextcloud:28-apache
6- container_name : it-stack-nextcloud
7- restart : unless-stopped
38+ nc-int-ldap :
39+ image : osixia/openldap:1.5.0
40+ container_name : nc-int-ldap
41+ environment :
42+ LDAP_ORGANISATION : " IT-Stack Lab"
43+ LDAP_DOMAIN : lab.local
44+ LDAP_ADMIN_PASSWORD : LdapAdmin05!
45+ LDAP_READONLY_USER : " true"
46+ LDAP_READONLY_USER_USERNAME : readonly
47+ LDAP_READONLY_USER_PASSWORD : ReadOnly05!
848 ports :
9- - " 80:$firstPort"
49+ - " 3890:389"
50+ networks :
51+ - nc-int-net
52+ healthcheck :
53+ test : ["CMD-SHELL", "ldapsearch -x -H ldap://localhost -b dc=lab,dc=local -D cn=admin,dc=lab,dc=local -w LdapAdmin05! > /dev/null 2>&1"]
54+ interval : 15s
55+ timeout : 10s
56+ retries : 5
57+ start_period : 20s
58+
59+ nc-int-db :
60+ image : postgres:16-alpine
61+ container_name : nc-int-db
1062 environment :
11- - IT_STACK_ENV=lab-05-integration
12- - KEYCLOAK_URL=
13- - DB_HOST=
14- - REDIS_HOST=
15- - SMTP_HOST=
16- - GRAYLOG_HOST=
17- extra_hosts :
18- - " lab-id1:10.0.50.11"
19- - " lab-db1:10.0.50.12"
20- - " lab-proxy1:10.0.50.15"
63+ POSTGRES_DB : nextcloud
64+ POSTGRES_USER : nextcloud
65+ POSTGRES_PASSWORD : Lab05Password!
66+ volumes :
67+ - nc-int-db-data:/var/lib/postgresql/data
2168 networks :
22- - it-stack-net
69+ - nc-int-db-net
70+ healthcheck :
71+ test : ["CMD-SHELL", "pg_isready -U nextcloud"]
72+ interval : 10s
73+ timeout : 5s
74+ retries : 5
75+
76+ nc-int-redis :
77+ image : redis:7-alpine
78+ container_name : nc-int-redis
79+ command : redis-server --requirepass Lab05Redis!
80+ networks :
81+ - nc-int-net
82+ healthcheck :
83+ test : ["CMD", "redis-cli", "-a", "Lab05Redis!", "ping"]
84+ interval : 10s
85+ timeout : 5s
86+ retries : 5
87+
88+ nc-int-keycloak :
89+ image : quay.io/keycloak/keycloak:24.0
90+ container_name : nc-int-keycloak
91+ command : start-dev
92+ environment :
93+ KC_HEALTH_ENABLED : " true"
94+ KEYCLOAK_ADMIN : admin
95+ KEYCLOAK_ADMIN_PASSWORD : Lab05Admin!
96+ ports :
97+ - " 8104:8080"
98+ networks :
99+ - nc-int-net
100+ healthcheck :
101+ test : ["CMD-SHELL", "curl -sf http://localhost:8080/health/ready | grep -q UP || exit 1"]
102+ interval : 20s
103+ timeout : 10s
104+ retries : 10
105+ start_period : 60s
106+
107+ nc-int-app :
108+ image : nextcloud:29-apache
109+ container_name : nc-int-app
110+ depends_on :
111+ nc-int-db :
112+ condition : service_healthy
113+ nc-int-redis :
114+ condition : service_healthy
115+ nc-int-keycloak :
116+ condition : service_healthy
117+ nc-int-ldap :
118+ condition : service_healthy
119+ environment :
120+ << : *nc-int-env
121+ ports :
122+ - " 8100:80"
123+ volumes :
124+ - nc-int-data:/var/www/html
125+ networks :
126+ - nc-int-net
127+ - nc-int-db-net
128+ healthcheck :
129+ test : ["CMD", "curl", "-f", "http://localhost/status.php"]
130+ interval : 30s
131+ timeout : 15s
132+ retries : 10
133+ start_period : 90s
134+
135+ nc-int-cron :
136+ image : nextcloud:29-apache
137+ container_name : nc-int-cron
138+ depends_on :
139+ nc-int-app :
140+ condition : service_healthy
141+ entrypoint : /cron.sh
142+ environment :
143+ << : *nc-int-env
144+ volumes :
145+ - nc-int-data:/var/www/html
146+ networks :
147+ - nc-int-net
148+ - nc-int-db-net
149+
150+ volumes :
151+ nc-int-db-data :
152+ nc-int-data :
23153
24154networks :
25- it-stack -net :
26- driver : bridge
155+ nc-int -net :
156+ nc-int-db-net:
0 commit comments