services:
  app:
    image: docuseal/docuseal:latest
    volumes:
      - docuseal:/data/docuseal
    depends_on:
      docu-postgres:
        condition: service_healthy
    restart: unless-stopped
    environment:
      - DATABASE_URL=postgresql://${POSTGRES_USER:-docuseal}:${POSTGRES_PASSWORD}@docu-postgres:5432/${POSTGRES_DB:-docuseal}
      
  docu-postgres:
    image: postgres:latest
    volumes:
      - docuseal-db:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_DB=${POSTGRES_DB}
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-docuseal} -d ${POSTGRES_DB:-docuseal}"]
      interval: 10s
      timeout: 5s
      retries: 5
      
  docu-redis:
    image: redis:alpine
    restart: always
    volumes:
      - docuseal-redis-data:/data
      
    
volumes:
  docuseal:
  docuseal-db:
  docuseal-redis-data: