binary1ne commited on
Commit
2f2998a
·
verified ·
1 Parent(s): 3463dc3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -15
Dockerfile CHANGED
@@ -1,24 +1,25 @@
 
1
  FROM quay.io/keycloak/keycloak:25.0.6 as builder
2
 
3
- # Build Keycloak with in-memory DB
4
- RUN /opt/keycloak/bin/kc.sh build --db=dev-mem
5
 
 
6
  FROM quay.io/keycloak/keycloak:25.0.6
7
 
8
- WORKDIR /opt/keycloak
 
9
 
10
- # Admin credentials (default for POC)
11
- ENV KEYCLOAK_ADMIN=admin \
12
- KEYCLOAK_ADMIN_PASSWORD=admin
13
-
14
- # Expose only port 7860 (the only open port in Hugging Face)
15
  EXPOSE 7860
16
 
17
- # Disable hostname strict mode so it won’t redirect to 0.0.0.0
18
- ENV KC_HOSTNAME_STRICT=false
19
- ENV KC_HOSTNAME=0.0.0.0
20
-
21
- ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
22
 
23
- # Run Keycloak on HTTP 7860
24
- CMD ["start-dev", "--http-port=7860", "--hostname-strict=false", "--hostname=0.0.0.0"]
 
 
 
 
 
1
+ # Use the official Keycloak image
2
  FROM quay.io/keycloak/keycloak:25.0.6 as builder
3
 
4
+ # Build with in-memory database support
5
+ RUN /opt/keycloak/bin/kc.sh build
6
 
7
+ # Final lightweight image
8
  FROM quay.io/keycloak/keycloak:25.0.6
9
 
10
+ # Copy the build artifacts
11
+ COPY --from=builder /opt/keycloak/ /opt/keycloak/
12
 
13
+ # Expose Hugging Face allowed port
 
 
 
 
14
  EXPOSE 7860
15
 
16
+ # Set environment variables for admin user
17
+ ENV KEYCLOAK_ADMIN=admin
18
+ ENV KEYCLOAK_ADMIN_PASSWORD=admin
 
 
19
 
20
+ # Start Keycloak in production mode with dev-mem DB
21
+ ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start", \
22
+ "--http-port=7860", \
23
+ "--hostname-strict=false", \
24
+ "--hostname-strict-https=false", \
25
+ "--db=dev-mem" ]