When running spotlight run without an explicit command, Spotlight uses the following logic:
1. package.json Detection
It searches for the first available script in your package.json in this order:
devdevelopservestart
2. Docker Compose Detection
It looks for Docker Compose files in the current directory or via the COMPOSE_FILE environment variable. Supported filenames include:
docker-compose.yml / docker-compose.yamlcompose.yml / compose.yaml
When Docker Compose is detected, Spotlight:
- Uses
host.docker.internal instead of localhost so containers can reach the host. - Injects
SENTRY_SPOTLIGHT, NEXT_PUBLIC_SENTRY_SPOTLIGHT, and SENTRY_TRACES_SAMPLE_RATE into all services. - Adds
extra_hosts mapping (host.docker.internal:host-gateway) for Linux compatibility.
Note: Docker Compose auto-detection requires Docker version 20.10.0 or higher.
Conflict Resolution
If both a package.json and a Docker Compose project are detected, Spotlight will prompt you to choose which one to use. To avoid this in non-interactive environments (like CI), specify the command explicitly:
spotlight run docker compose up
# or
spotlight run npm run dev