docker yml

gustjtmd·2023년 11월 29일
version: '3'


services:
  keycloak:
    image: quay.io/keycloak/keycloak:17.0.1
    container_name: keycloak
    environment:
        KC_DB: postgres
        KC_DB_URL: jdbc:postgresql://url/keycloakdb17
        KC_DB_USERNAME: *
        KC_DB_PASSWORD: *
        KEYCLOAK_ADMIN: *
        KEYCLOAK_ADMIN_PASSWORD: *
        # Uncomment the line below if you want to specify JDBC parameters. The parameter below is just an example, and it shouldn't be used in production without knowledge. It is highly recommended that you read the PostgreSQL JDBC driver documentation in order to use it.
        #JDBC_PARAMS: "ssl=true"
    ports:
      - "5010:8080"
    command: start-dev
## 2. docker-compose.yml
```shell
version: "3.3"
services:
  postgres:
    image: postgres:15.3
    container_name: postgres
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_DB=keycloak
      - POSTGRES_USER=keycloak
      - POSTGRES_PASSWORD=password
    healthcheck:
      test: "pg_isready -U postgres"
    volumes:
      - ./pg_data:/var/lib/postgresql/data

  keycloak:
    image: quay.io/keycloak/keycloak:22.0.1
    container_name: keycloak
    environment:
      - KEYCLOAK_ADMIN=*
      - KEYCLOAK_ADMIN_PASSWORD=*
      - KC_DB=postgres
      - KC_DB_URL_HOST=postgres
      - KC_DB_URL_DATABASE=keycloak
      - KC_DB_USERNAME=keycloak
      - KC_DB_PASSWORD=password
      - KC_HEALTH_ENABLED=true
    ports:
      - "8080:8080"
    command: start-dev
    depends_on:
      - postgres
    healthcheck:
      test: "curl -f http://localhost:8080/health/ready || exit 1"
profile
반갑습니다

0개의 댓글