1- # Lab 05 — Advanced Integration: freeipa with full IT-Stack ecosystem
2- ---
31services :
2+
3+ # ── FreeIPA identity directory ────────────────────────────────────
44 freeipa :
5- image : freeipa/freeipa-server:rocky-9
6- container_name : it-stack-freeipa
7- restart : unless-stopped
5+ image : freeipa/freeipa-server:fedora-41
6+ container_name : freeipa-lab05
7+ hostname : ipa.lab.local
8+ privileged : true
9+ tty : true
10+ stdin_open : true
11+ environment :
12+ IPA_SERVER_IP : 172.21.0.10
13+ IPA_SERVER_HOSTNAME : ipa.lab.local
14+ command :
15+ - ipa-server-install
16+ - --unattended
17+ - --realm=LAB.LOCAL
18+ - --domain=lab.local
19+ - --ds-password=Lab05Password!
20+ - --admin-password=Lab05Password!
21+ - --no-ntp
22+ - --no-host-dns
23+ - --setup-dns
24+ - --auto-forwarders
25+ volumes :
26+ - freeipa-int:/data
27+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
28+ tmpfs :
29+ - /run
30+ - /tmp
831 ports :
9- - " 389:$firstPort"
32+ - " 389:389"
33+ - " 636:636"
34+ - " 88:88/tcp"
35+ - " 88:88/udp"
36+ networks :
37+ ipa-int-net :
38+ ipv4_address : 172.21.0.10
39+ sysctls :
40+ - net.ipv6.conf.all.disable_ipv6=0
41+ healthcheck :
42+ test : ["CMD", "ipa", "user-find", "--all"]
43+ interval : 30s
44+ timeout : 10s
45+ retries : 20
46+ start_period : 300s
47+
48+ # ── Keycloak DB ───────────────────────────────────────────────────
49+ kc-db :
50+ image : postgres:16-alpine
1051 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"
52+ POSTGRES_DB : keycloak
53+ POSTGRES_USER : kcadmin
54+ POSTGRES_PASSWORD : Lab05Password!
2155 networks :
22- - it-stack-net
56+ - kc-db-net
57+ volumes :
58+ - kc-db-int:/var/lib/postgresql/data
59+ healthcheck :
60+ test : ["CMD-SHELL", "pg_isready -U kcadmin"]
61+ interval : 5s
62+ timeout : 3s
63+ retries : 20
64+
65+ # ── Keycloak: federates FreeIPA users via LDAP ────────────────────
66+ keycloak :
67+ image : quay.io/keycloak/keycloak:24.0
68+ command : start-dev
69+ depends_on :
70+ kc-db :
71+ condition : service_healthy
72+ environment :
73+ KC_BOOTSTRAP_ADMIN_USERNAME : admin
74+ KC_BOOTSTRAP_ADMIN_PASSWORD : Lab05Password!
75+ KC_DB : postgres
76+ KC_DB_URL : " jdbc:postgresql://kc-db:5432/keycloak"
77+ KC_DB_USERNAME : kcadmin
78+ KC_DB_PASSWORD : Lab05Password!
79+ KC_HTTP_PORT : " 8080"
80+ KC_HOSTNAME_STRICT : " false"
81+ KC_PROXY : edge
82+ ports :
83+ - " 8080:8080"
84+ networks :
85+ - ipa-int-net
86+ - kc-db-net
87+ healthcheck :
88+ test : ["CMD-SHELL", "curl -sf http://localhost:8080/health/ready || exit 1"]
89+ interval : 10s
90+ timeout : 5s
91+ retries : 30
92+ start_period : 60s
93+
94+ # ── PostgreSQL: app database with LDAP auth attempted ─────────────
95+ postgres :
96+ image : postgres:16-alpine
97+ environment :
98+ POSTGRES_DB : labapp
99+ POSTGRES_USER : labadmin
100+ POSTGRES_PASSWORD : Lab05Password!
101+ ports :
102+ - " 5432:5432"
103+ networks :
104+ - ipa-int-net
105+ volumes :
106+ - pg-int:/var/lib/postgresql/data
107+ healthcheck :
108+ test : ["CMD-SHELL", "pg_isready -U labadmin"]
109+ interval : 5s
110+ timeout : 3s
111+ retries : 15
112+
113+ # ── Redis: shared session store ────────────────────────────────────
114+ redis :
115+ image : redis:7.2-alpine
116+ command : redis-server --requirepass Lab05Password! --appendonly yes
117+ ports :
118+ - " 6379:6379"
119+ networks :
120+ - ipa-int-net
121+ volumes :
122+ - redis-int:/data
123+ healthcheck :
124+ test : ["CMD", "redis-cli", "-a", "Lab05Password!", "--no-auth-warning", "PING"]
125+ interval : 5s
126+ timeout : 3s
127+ retries : 15
23128
24129networks :
25- it-stack -net :
130+ ipa-int -net :
26131 driver : bridge
132+ ipam :
133+ config :
134+ - subnet : 172.21.0.0/24
135+ kc-db-net :
136+ driver : bridge
137+ internal : true
138+
139+ volumes :
140+ freeipa-int :
141+ kc-db-int :
142+ pg-int :
143+ redis-int:
0 commit comments