-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
53 lines (39 loc) · 1.51 KB
/
Dockerfile
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
### Keycloak base image with ErWIn-IDM extensions
FROM quay.io/keycloak/keycloak:25.0.1 AS base
# ErWIn specific extensions (providers, themes, etc.)
#COPY src/conf/ /opt/keycloak/conf/
COPY src/providers/ /opt/keycloak/providers/
#COPY src/themes/ /opt/keycloak/themes/
### Development image
## Build
FROM base AS development-build
# Keycloak settings for developers mode
ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
ENV KC_DB=dev-file
ENV KC_CACHE=local
ENV KC_FEATURES_DISABLED=impersonation,ciba,par,web-authn
RUN /opt/keycloak/bin/kc.sh build
## Run
FROM development-build as development
COPY --from=development-build /opt/keycloak/lib/quarkus/ /opt/keycloak/lib/quarkus/
WORKDIR /opt/keycloak
# auto-generated keys for HTTPS in developers mode
RUN keytool -genkeypair -storepass password -storetype PKCS12 -keyalg RSA -keysize 2048 -dname "CN=erwin-idm-server" -alias erwin -ext "SAN:c=DNS:localhost,IP:127.0.0.1" -validity 365 -keystore conf/server.keystore
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start-dev"]
### Production image
## Build
FROM base AS production-build
# Keycloak settings for production mode
ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
ENV KC_DB=postgres
ENV KC_FEATURES_DISABLED=impersonation,ciba,par,web-authn
ENV KC_CACHE=ispn
ENV KC_CACHE_STACK=kubernetes
RUN /opt/keycloak/bin/kc.sh build
## Run
FROM production-build as production
COPY --from=production-build /opt/keycloak/lib/quarkus/ /opt/keycloak/lib/quarkus/
WORKDIR /opt/keycloak
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start"]