version: '3.1'

services:
  spark:
    image: docker.io/bitnami/spark:3.5.3
    environment:
      - SPARK_MODE=master
      - SPARK_RPC_AUTHENTICATION_ENABLED=no
      - SPARK_RPC_ENCRYPTION_ENABLED=no
      - SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no
      - SPARK_SSL_ENABLED=no
      - SPARK_USER=spark
    ports:
      - '8080:8080'
      - '7077:7077'
  spark-worker:
    image: docker.io/bitnami/spark:3.5.3
    environment:
      - SPARK_MODE=worker
      - SPARK_MASTER_URL=spark://spark:7077
      - SPARK_WORKER_MEMORY=1G # can be changed
      - SPARK_WORKER_CORES=1 # can be changed
      - SPARK_RPC_AUTHENTICATION_ENABLED=no
      - SPARK_RPC_ENCRYPTION_ENABLED=no
      - SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no
      - SPARK_SSL_ENABLED=no
      - SPARK_USER=spark
  minio:
    image: minio/minio
    container_name: minio
    environment:
      MINIO_ROOT_USER: root
      MINIO_ROOT_PASSWORD: password
    command: server /data --console-address ":9001"
    ports:
      - "19000:9000"
      - "19001:9001"

  notebook:
    image: grosinosky/bigdata_fila3_jupyter
    build:
      context: .
      dockerfile: Dockerfile
    container_name: jupyter
    ports: 
    - "8888:8888"
    - "4040:4040"    
    environment:
      JUPYTER_ENABLE_LAB: yes
    command: start-notebook.py --NotebookApp.token=''