services:
  app:
    build: .
    restart: unless-stopped
    ports:
      - "8080:80"
    environment:
      APP_ENV: production
      APP_URL: http://localhost:8080
      APP_NAME: Levantamientos CAD
      APP_TIMEZONE: America/Mexico_City
      SESSION_SECURE: "false"
      SESSION_NAME: levantamientos_session
      DB_DSN: mysql:host=db;port=3306;dbname=levantamientos;charset=utf8mb4
      DB_USER: levantamientos
      DB_PASSWORD: cambiar-esta-clave-db
      MAX_UPLOAD_MB: "15"
      PDF_ENABLED: "true"
    volumes:
      - app_storage:/var/www/html/storage
    depends_on:
      db:
        condition: service_healthy

  db:
    image: mariadb:11
    restart: unless-stopped
    environment:
      MARIADB_DATABASE: levantamientos
      MARIADB_USER: levantamientos
      MARIADB_PASSWORD: cambiar-esta-clave-db
      MARIADB_ROOT_PASSWORD: cambiar-esta-clave-root
      TZ: America/Mexico_City
    volumes:
      - db_data:/var/lib/mysql
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      interval: 5s
      timeout: 5s
      retries: 20

volumes:
  app_storage:
  db_data:
