# https://waha.devlike.pro/docs/how-to/install/
services:
  waha:
    restart: always
    # https://waha.devlike.pro/docs/how-to/engines/#docker-images
    # https://portal.devlike.pro/docker-image
    image: devlikeapro/waha-plus
    # WAHA Core
    # image: devlikeapro/waha:latest

    ports:
      - '127.0.0.1:3000:3000/tcp'

    volumes:
      # Store sessions in the .sessions folder (comment it if you're using MongoDB)
      - './sessions:/app/.sessions'

      # Save media files
      # https://waha.devlike.pro/docs/how-to/storages/#save-media-files-between-the-container-restarts
      - './.media:/app/.media'

    env_file:
      - .env

# NOTE: Only if you're using PostgreSQL to save sessions
# https://waha.devlike.pro/docs/how-to/storages/#media---postgresql
#  postgres:
#    image: postgres:17
#    restart: always
#    environment:
#      POSTGRES_USER: postgres
#      POSTGRES_PASSWORD: postgres
#      POSTGRES_DB: postgres
#    ports:
#      - "5432:5432"
#    volumes:
#      - pg_data:/var/lib/postgresql/data
#    command:
#      - postgres
#      - "-c"
#      - "max_connections=3000"

# NOTE: Only if you're using MongoDB
# https://waha.devlike.pro/docs/how-to/storages/#sessions---mongodb
# Uncomment this block if you're using MongoDB
#  mongodb:
#    image: mongo
#    container_name: mongodb
#    ports:
#      - '127.0.0.1:27017:27017/tcp'
#    volumes:
#      - mongodb_data:/data/db
#    environment:
#      - MONGO_INITDB_ROOT_USERNAME=mongouser
#      - MONGO_INITDB_ROOT_PASSWORD=mongopassword

# NOTE: Only if you're using S3 to save media files
# https://waha.devlike.pro/docs/how-to/storages/#media---s3
# Uncomment this block if you're using AWS S3
#  minio:
#    image: quay.io/minio/minio
#    container_name: minio
#    restart: always
#    ports:
#      - '127.0.0.1:9000:9000'
#      - '127.0.0.1:9001:9001'
#    environment:
#      MINIO_REGION: 'eu-west-2'
#      MINIO_ROOT_USER: 'minioadmin'
#      MINIO_ROOT_PASSWORD: 'minioadmin'
#    volumes:
#      - minio_data:/data
#    command: server /data --console-address ":9001"

volumes:
  mongodb_data: {}
  minio_data: {}
  pg_data: {}
