version: '3'
services:
  cas:
    # Tag version does not really represent CAS server version. Please check pom.xml to get real version.
    image: apereo/cas:v5.1.3
    ports:
      - "8080:8080"
    volumes:
      - ./docker/tmp:/root/.m2/repository/
      - ./docker/cas.properties:/cas-overlay/etc/cas/config/cas.properties:ro
      - ./docker/All-10000005.json:/cas-overlay/etc/cas/services/All-10000005.json:ro
      - ./docker/pom.xml:/cas-overlay/pom.xml
  app:
    build:
      context: ../
      dockerfile: cas-security-spring-boot-sample/Dockerfile
    image: cas-security-spring-boot-sample:0.5.0
    ports:
      - "8081:8081"
      - "5005"
    environment:
      - SPRING_PROFILES_ACTIVE=docker
      - JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005


version: '2.1'
services:
  cas:
    # Tag version does not really represent CAS server version. Please check pom.xml to get real version.
    image: apereo/cas:v5.1.3
    ports:
      - "8080:8080"
    volumes:
      - ./docker/tmp:/root/.m2/repository/
      - ./docker/cas.properties:/cas-overlay/etc/cas/config/cas.properties:ro
      - ./docker/All-10000005.json:/cas-overlay/etc/cas/services/All-10000005.json:ro
      - ./docker/pom.xml:/cas-overlay/pom.xml
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/cas"]
      interval: 1m30s
      timeout: 30s
      retries: 5
  app:
    build:
      context: ../
      dockerfile: cas-security-spring-boot-sample/Dockerfile
    image: cas-security-spring-boot-sample:0.5.0
    ports:
      - "8081:8081"
      - "5005"
    environment:
      - SPRING_PROFILES_ACTIVE=docker
      - JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
    depends_on:
      cas:
        condition: service_healthy


Add docker healtcheck and depends_on
Add docker healtcheck and depends_on
