# ============================================
# SOCIAL MEDIA MANAGER - DOCKER CONFIGURATION
# ============================================

# ============================================
# SERVER CONFIGURATION
# ============================================
server:
  port: ${SERVER_PORT:8000}
  servlet:
    encoding:
      charset: UTF-8
      enabled: true
      force: true

spring:
  application:
    name: social-media-manager
  # ============================================
  # DATABASE CONFIGURATION - PostgreSQL 17
  # ============================================
  datasource:
    url: ${DATABASE_URL:jdbc:postgresql://162.240.175.216:5432/wwinst_social_media_manager_prd}
    username: ${DATABASE_USERNAME:wwinst_root}
    password: ${DATABASE_PASSWORD:Adorigram190120!}
    driver-class-name: org.postgresql.Driver
    hikari:
      maximum-pool-size: ${DB_POOL_SIZE:20}
      minimum-idle: ${DB_POOL_MIN_IDLE:5}
      connection-timeout: 20000
      
  jpa:
    hibernate:
      ddl-auto: validate  # Use 'validate' in production/docker instead of 'update'
      naming:
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
        implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
    show-sql: false  # Disable SQL logging in docker/production
    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect
        "[format_sql]": false
        "[default_schema]": core_business

# ============================================
# ACTUATOR & MONITORING
# ============================================
management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics
      base-path: /actuator
  endpoint:
    health:
      show-details: when-authorized  # More secure for production

# ============================================
# LOGGING CONFIGURATION
# ============================================
logging:
  level:
    "[com.social.media]": INFO
    "[org.springframework.security]": WARN
    "[org.hibernate.SQL]": WARN
    root: WARN  # Reduce noise in docker logs
  file:
    name: ${LOG_FILE_PATH:/app/logs/social-media-manager.log}
  pattern:
    console: "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
    file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"

# ============================================
# SPRINGDOC OPENAPI CONFIGURATION
# ============================================
springdoc:
  api-docs:
    path: /v3/api-docs
    enabled: true
  swagger-ui:
    path: /swagger-ui.html
    enabled: true
