Integrer l'authentification Keycloak dans l'application
This commit is contained in:
@@ -1,14 +1,37 @@
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: chesscubing-web
|
||||
depends_on:
|
||||
auth:
|
||||
condition: service_started
|
||||
keycloak:
|
||||
condition: service_started
|
||||
ports:
|
||||
- "8080:80"
|
||||
restart: unless-stopped
|
||||
|
||||
auth:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.auth
|
||||
container_name: chesscubing-auth
|
||||
environment:
|
||||
ASPNETCORE_URLS: http://+:8080
|
||||
KEYCLOAK_BASE_URL: http://keycloak:8080/auth
|
||||
KEYCLOAK_REALM: chesscubing
|
||||
KEYCLOAK_CLIENT_ID: chesscubing-web
|
||||
KEYCLOAK_ADMIN_USERNAME: ${KEYCLOAK_ADMIN_USER:-admin}
|
||||
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin}
|
||||
depends_on:
|
||||
keycloak-init:
|
||||
condition: service_completed_successfully
|
||||
keycloak:
|
||||
condition: service_started
|
||||
restart: unless-stopped
|
||||
|
||||
keycloak:
|
||||
image: quay.io/keycloak/keycloak:26.1.2
|
||||
container_name: chesscubing-keycloak
|
||||
@@ -33,6 +56,23 @@ services:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
keycloak-init:
|
||||
image: quay.io/keycloak/keycloak:26.1.2
|
||||
container_name: chesscubing-keycloak-init
|
||||
entrypoint: ["/bin/sh", "/opt/keycloak/data/scripts/init-config.sh"]
|
||||
environment:
|
||||
KEYCLOAK_URL: http://keycloak:8080/auth
|
||||
KEYCLOAK_REALM: chesscubing
|
||||
KEYCLOAK_CLIENT_ID: chesscubing-web
|
||||
KEYCLOAK_ADMIN_USERNAME: ${KEYCLOAK_ADMIN_USER:-admin}
|
||||
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin}
|
||||
volumes:
|
||||
- ./keycloak/scripts:/opt/keycloak/data/scripts:ro
|
||||
depends_on:
|
||||
keycloak:
|
||||
condition: service_started
|
||||
restart: "no"
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: chesscubing-keycloak-db
|
||||
|
||||
Reference in New Issue
Block a user