services:
  mysql:
    image: mysql:8.0
    container_name: ppanel-mysql
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: ppanel_dev
      MYSQL_DATABASE: ppanel
      MYSQL_USER: ppanel
      MYSQL_PASSWORD: ppanel_dev
    ports:
      - "3306:3306"
    volumes:
      - ppanel_mysql_data:/var/lib/mysql
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-pppanel_dev"]
      interval: 10s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    container_name: ppanel-redis
    restart: unless-stopped
    ports:
      - "6379:6379"
    volumes:
      - ppanel_redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 3s
      retries: 5

volumes:
  ppanel_mysql_data:
  ppanel_redis_data:
