update Dockerfile for prod

This commit is contained in:
Grégory Lebreton 2025-08-29 10:29:36 +02:00
parent 1c0279b30f
commit 05bd6588dc

View File

@ -35,9 +35,9 @@ RUN mkdir -p /opt/keycloak/data/import \
&& chown -R 1000:1000 /opt/keycloak/themes
# Copy configuration files
# COPY deploy/config/realm/ /opt/keycloak/data/import/
# COPY files/realm.json /opt/keycloak/data/import/
# COPY deploy/config/user-profile.json /opt/keycloak/conf/user-profile.json
COPY deploy/config/keycloak.conf /opt/keycloak/conf/keycloak.conf
COPY files/keycloak.conf /opt/keycloak/conf/keycloak.conf
# Copy custom themes (if any)
# COPY deploy/config/themes/ /opt/keycloak/themes/
@ -49,7 +49,7 @@ RUN chown -R 1000:1000 /opt/keycloak/data/import \
# Switch back to keycloak user for security
USER 1000
# Set runtime environment variables TO CHANGE FOR PROD !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Set runtime environment variables (overriden by keycloak.conf or compose envs)
ENV KC_DB=postgres \
KC_HEALTH_ENABLED=true \
KC_METRICS_ENABLED=true \
@ -59,7 +59,7 @@ ENV KC_DB=postgres \
KC_LOG_LEVEL=INFO
# Expose ports
EXPOSE 8080 9000
EXPOSE 8080 9000 8443
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \