services:
  smartbooking:
    image: git.bigc.it/sbierti/smartbooking:latest
    environment:
      - _JAVA_OPTIONS=-Xmx512m -Xms256m
      - SPRING_PROFILES_ACTIVE=prod,api-docs
      - MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED=true
      - SPRING_DATASOURCE_URL=jdbc:postgresql://smartbooking-postgresql:5432/smartbooking
      - SPRING_LIQUIBASE_URL=jdbc:postgresql://smartbooking-postgresql:5432/smartbooking
      - JHIPSTER_SLEEP=30
    ports:
      - 8080:8080
    depends_on:
      - postgresql
  postgresql:
    image: postgres:18.1
    # volumes:
    #   - ~/volumes/jhipster/smartbooking/postgresql/:/var/lib/postgresql/data/
    environment:
      - POSTGRES_USER=smartbooking
      - POSTGRES_HOST_AUTH_METHOD=trust
    healthcheck:
      test: [ 'CMD-SHELL', 'pg_isready -U $${POSTGRES_USER}' ]
      interval: 5s
      timeout: 5s
      retries: 10
    # If you want to expose these ports outside your dev PC,
    # remove the "127.0.0.1:" prefix
    ports:
      - 127.0.0.1:5432:5432

