networks:
  local:
  rauthy-dev:

services:
  db:
    image: postgres:18.1-alpine
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: mv_dev
    volumes:
      - postgres-data:/var/lib/postgresql/data
    ports:
      - "5000:5432"
    networks:
      - local

  mailcrab:
    image: marlonb/mailcrab:latest
    ports:
      - "1080:1080"
    networks:
      - rauthy-dev

  rauthy:
    container_name: rauthy-dev
    image: ghcr.io/sebadob/rauthy:0.34.3
    environment:
      - LOCAL_TEST=true
      - SMTP_URL=mailcrab
      - SMTP_PORT=1025
      - SMTP_DANGER_INSECURE=true
      - LISTEN_SCHEME=http
      - PUB_URL=localhost:8080
      - BOOTSTRAP_ADMIN_PASSWORD_PLAIN=RauthyTest12345
      # Disable strict IP validation to allow access from multiple Docker networks
      - SESSION_VALIDATE_IP=false
    ports:
      - "8080:8080"
    depends_on:
      - mailcrab
      - db
    networks:
      - rauthy-dev
      - local
    volumes:
      - rauthy-data:/app/data

volumes:
  postgres-data:
  rauthy-data:
