services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8000:8000"
    volumes:
      - .:/var/www/html
    environment:
      - APP_ENV=local
    depends_on:
      - mysql
      - redis
      - meilisearch
      - minio
    networks:
      - instaparty

  mysql:
    image: mysql:8.0
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-secret}
      MYSQL_DATABASE: ${DB_DATABASE:-instaparty}
      MYSQL_USER: ${DB_USERNAME:-instaparty}
      MYSQL_PASSWORD: ${DB_PASSWORD:-secret}
    volumes:
      - mysql_data:/var/lib/mysql
    networks:
      - instaparty

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    networks:
      - instaparty

  meilisearch:
    image: getmeili/meilisearch:v1.7
    ports:
      - "7700:7700"
    environment:
      MEILI_MASTER_KEY: ${MEILISEARCH_KEY:-masterKey}
    volumes:
      - meilisearch_data:/meili_data
    networks:
      - instaparty

  mailpit:
    image: axllent/mailpit:latest
    ports:
      - "1025:1025"   # SMTP
      - "8025:8025"   # Web UI
    networks:
      - instaparty

  minio:
    image: minio/minio:latest
    ports:
      - "9000:9000"   # S3 API
      - "9001:9001"   # Web console
    environment:
      MINIO_ROOT_USER: ${AWS_ACCESS_KEY_ID:-minio}
      MINIO_ROOT_PASSWORD: ${AWS_SECRET_ACCESS_KEY:-minio123}
    command: server /data --console-address ":9001"
    volumes:
      - minio_data:/data
    networks:
      - instaparty

volumes:
  mysql_data:
  meilisearch_data:
  minio_data:

networks:
  instaparty:
    driver: bridge
