version: '3.8'

services:
  # Serviço principal do Camunda BPM Platform
  camunda:
    image: camunda/camunda-bpm-platform:latest
    container_name: camunda-bpm
    ports:
      - "8082:8080"
    environment:
      # Configuração do banco de dados
      - DB_DRIVER=org.postgresql.Driver
      - DB_URL=jdbc:postgresql://camunda-db:5432/camunda
      - DB_USERNAME=camunda
      - DB_PASSWORD=camunda
      - WAIT_FOR=camunda-db:5432
    depends_on:
      - camunda-db
    networks:
      - camunda-network
    restart: unless-stopped

  # Banco de dados PostgreSQL para o Camunda
  camunda-db:
    image: postgres:13
    container_name: camunda-db
    environment:
      - POSTGRES_USER=camunda
      - POSTGRES_PASSWORD=camunda
      - POSTGRES_DB=camunda
    volumes:
      - camunda-db-data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    networks:
      - camunda-network
    restart: unless-stopped

networks:
  camunda-network:
    driver: bridge

volumes:
  camunda-db-data:
