version: "3.8"
services:
  test_db:
    image: postgres
    restart: always
    environment:
      - POSTGRES_ROOT_PASSWORD
      - POSTGRES_USER
      - POSTGRES_PASSWORD
      - POSTGRES_DB
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 10s
      timeout: 5s
      retries: 5

  test_comfy:
    image: ${COMFY_IMAGE}
    depends_on:
      test_db:
        condition: service_healthy
    user: "${UID}:${GID}"
    environment:
      - UID
      - GID
      - SECRET_KEY
      - DATABASE_URL
      - DJANGO_SETTINGS_MODULE
    command:
      python manage.py test --noinput

