-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
146 lines (139 loc) · 3.52 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
version: "3"
services:
watcher:
build:
context: ./watcher
dockerfile: Dockerfile.watcher
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./themes:/themes
depends_on:
- keycloak
web:
build:
context: ./web-app
dockerfile: Dockerfile.web
ports:
- 4200:443
networks:
- web_network
depends_on:
- keycloak
profiles:
- angular
web-simple:
build:
context: ./web-app_simple
dockerfile: Dockerfile.web
ports:
- 8080:80
networks:
- web_network
depends_on:
- keycloak
profiles:
- web-simple
postgresql:
image: postgres:15-alpine
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak
POSTGRES_PORT: 5432
networks:
- postgresql_network
volumes:
- postgres-data:/var/lib/postgresql-data
- postgres-volume:/home
keycloak:
image: quay.io/keycloak/keycloak
volumes:
- ./themes:/opt/keycloak/themes
- ./import/test-realm.json:/opt/keycloak/data/import/test-realm.json
- https:/etc/x509/https:ro
command:
- start
- --optimized
- --hostname=localhost
- --hostname-strict-backchannel=true
- --https-certificate-file=/etc/x509/https/tls.crt
- --https-certificate-key-file=/etc/x509/https/tls.key
- --https-key-store-file=/etc/x509/https/keystore.jks
- --https-key-store-password=password
- --https-key-store-type=JKS
- --import-realm
- --spi-theme-static-max-age=-1
- --spi-theme-cache-themes=false
- --spi-theme-cache-templates=false
- --verbose
environment:
DB_VENDOR: postgres
DB_ADDR: postgres
DB_DATABASE: keycloak
DB_SCHEMA: public
DB_USER: keycloak
DB_PASSWORD: keycloak
DB_PORT: 5432
QUARKUS_HTTP_HOST: 0.0.0.0
KEYCLOAK_FRONTEND_URL: https://localhost:8443
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: password
ports:
- 8443:8443
networks:
- keycloak_network
depends_on:
- postgresql
- maildev
- cert-setup
maildev:
image: maildev/maildev
ports:
- 1080:1080
environment:
MAILDEV_SMTP_PORT: 25
networks:
- keycloak_network
- maildev_network
cert-setup:
image: alpine
volumes:
- https:/etc/x509/https
- ./certs/certificate.cnf:/etc/ssl/certificate.cnf
command:
- /bin/sh
- -c
- |
apk add --no-cache openssl openjdk8 && \
openssl req -x509 -nodes \
-days 365 \
-newkey rsa:2048 \
-keyout /etc/x509/https/tls.key \
-out /etc/x509/https/tls.crt \
-config /etc/ssl/certificate.cnf \
-subj '/CN=localhost' \
&& openssl pkcs12 -export \
-in /etc/x509/https/tls.crt \
-inkey /etc/x509/https/tls.key \
-out /etc/x509/https/keystore.p12 \
-name localhost \
-password pass:password \
&& keytool -importkeystore \
-srckeystore /etc/x509/https/keystore.p12 \
-srcstoretype pkcs12 \
-destkeystore /etc/x509/https/keystore.jks \
-deststoretype jks \
-storepass password \
-srcstorepass password \
-noprompt \
&& chmod 644 /etc/x509/https/tls.* \
&& chmod 644 /etc/x509/https/keystore.*
volumes:
postgres-volume:
postgres-data:
https:
networks:
web_network:
maildev_network:
postgresql_network:
keycloak_network: