# Include syntax requires Docker compose > 2.20.3
# https://docs.docker.com/compose/release-notes/#2203
include:
  # Creates the internal MongoDB replica set
  - path: ../../services/mongo.yaml

services:
  # Extend PowerSync with Mongo healthchecks
  powersync:
    extends:
      file: ../../services/powersync.yaml
      service: powersync
    depends_on:
      mongo-rs-init:
        condition: service_completed_successfully
    volumes:
      - ./config:/config
    networks:
      - default
      #- supabase_network_powersync_datafy
    environment:
      PS_SUPABASE_JWT_SECRET: ${PS_SUPABASE_JWT_SECRET}

# Supabase exposes their services on this network
# networks:
  # This is derived from `supabase_network_${project_id}`
  # Where project_id is defined in the `config.toml` file.
  # supabase_network_powersync_datafy:
  #   name: "supabase_network_powersync_datafy"
  #   driver: bridge
  #   external: true
