version: '3'

services:
  pet-clinic:
    build: ./
    healthcheck:
      test: [ "CMD", "curl", "-f", "http://localhost:8082/" ]
      interval: 20s
      timeout: 10s
      retries: 4
      start_period: 5s
    ports:
      - "8082:8082"
    entrypoint: java -jar app.jar

  mysql:
    image: mysql:8.0
    ports:
      - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=
      - MYSQL_ALLOW_EMPTY_PASSWORD=true
      - MYSQL_USER=petclinic
      - MYSQL_PASSWORD=petclinic
      - MYSQL_DATABASE=petclinic
    volumes:
      - "./conf.d:/etc/mysql/conf.d:ro"
  postgres:
    image: postgres:15.3
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_PASSWORD=petclinic
      - POSTGRES_USER=petclinic
      - POSTGRES_DB=petclinic
