services:
  db:
    volumes:
      - ./data/db:/var/lib/postgresql/data
      - ./supabase/migrations/00-run-init.sh:/docker-entrypoint-initdb.d/00-run-init.sh:ro
      - ./supabase/migrations/01-init.sql:/sql/01-init.sql:ro

  storage:
    volumes:
      - ./data/storage:/var/lib/storage

  imgproxy:
    volumes:
      - ./data/storage:/var/lib/storage

  post-init:
    volumes:
      - ./supabase/migrations/post-boot.sql:/sql/post-boot.sql:ro
      - ./supabase/migrations/02-leads.sql:/sql/02-leads.sql:ro
      - ./supabase/migrations/03-booking-flow.sql:/sql/03-booking-flow.sql:ro
      - ./supabase/migrations/04-kaution-weekend-km.sql:/sql/04-kaution-weekend-km.sql:ro
      - ./supabase/migrations/05-create-lead-rpc.sql:/sql/05-create-lead-rpc.sql:ro
      - ./supabase/migrations/06-admin-pricing-documents.sql:/sql/06-admin-pricing-documents.sql:ro
      - ./supabase/migrations/07-sales-orders.sql:/sql/07-sales-orders.sql:ro
      - ./supabase/migrations/08-backend-pricing-and-security.sql:/sql/08-backend-pricing-and-security.sql:ro
      - ./supabase/migrations/09-site-settings.sql:/sql/09-site-settings.sql:ro
      - ./supabase/migrations/10-mietvertrag-workflow.sql:/sql/10-mietvertrag-workflow.sql:ro
      - ./supabase/migrations/11-consolidate-km-rental.sql:/sql/11-consolidate-km-rental.sql:ro
      - ./supabase/migrations/12-email-sent-and-more.sql:/sql/12-email-sent-and-more.sql:ro
      - ./supabase/migrations/13-rental-type-daily-and-email-guard.sql:/sql/13-rental-type-daily-and-email-guard.sql:ro
      - ./supabase/migrations/14-email-requested-trigger.sql:/sql/14-email-requested-trigger.sql:ro
      - ./supabase/migrations/15-individuell-vat-subtotal-fix.sql:/sql/15-individuell-vat-subtotal-fix.sql:ro
      - ./supabase/migrations/16-rental-type-weekend-gap-fix.sql:/sql/16-rental-type-weekend-gap-fix.sql:ro
      - ./supabase/migrations/17-vehicle-photos.sql:/sql/17-vehicle-photos.sql:ro

  kong:
    volumes:
      - ./supabase/kong.yml:/home/kong/kong.yml:ro

  web:
    volumes:
      - ./frontend:/usr/share/nginx/html
      - ./frontend/nginx.conf:/etc/nginx/conf.d/default.conf:ro

  web-admin:
    volumes:
      - ./frontend:/usr/share/nginx/html
      - ./frontend/nginx-admin.conf:/etc/nginx/conf.d/default.conf:ro

  n8n:
    environment:
      N8N_SECURE_COOKIE: "false"
    volumes:
      - ./data/n8n:/home/node/.n8n
      - ./n8n/workflows:/opt/mc-cars/workflows:ro
      - ./n8n/bootstrap:/opt/mc-cars/bootstrap:ro
