90 lines
2.7 KiB
Markdown
90 lines
2.7 KiB
Markdown
# Infra
|
|
|
|
Local Docker environment for Supabase stack and supporting services.
|
|
|
|
## Quick Start
|
|
|
|
1. Copy environment file:
|
|
```bash
|
|
cp infra/env/.env.example infra/env/.env.local
|
|
```
|
|
|
|
2. Update `infra/env/.env.local` with your secrets and configurations.
|
|
**Important**: Ensure all required fields are filled (no `CHANGE_ME` values).
|
|
|
|
3. Start services:
|
|
```bash
|
|
docker compose --env-file infra/env/.env.local -f infra/local/docker-compose.yml up -d
|
|
```
|
|
|
|
## Access
|
|
|
|
- **Supabase Studio**: http://localhost:8001
|
|
Credentials from `DASHBOARD_USERNAME` and `DASHBOARD_PASSWORD` in `.env.local`
|
|
- **Qdrant**: http://localhost:6333
|
|
- **Redis**: localhost:6379
|
|
|
|
## Troubleshooting
|
|
|
|
### Port Conflicts
|
|
|
|
If `localhost:8001` is unreachable, check for port conflicts:
|
|
|
|
**Linux/WSL:**
|
|
```bash
|
|
ss -ltnp 'sport = :8001'
|
|
```
|
|
|
|
**Windows:**
|
|
```powershell
|
|
Get-NetTCPConnection -LocalPort 8001 | Select-Object LocalAddress, LocalPort, State, OwningProcess
|
|
Get-Process -Id (Get-NetTCPConnection -LocalPort 8001).OwningProcess
|
|
```
|
|
|
|
If a Windows service occupies the port, either:
|
|
- Stop the conflicting service
|
|
- Change `KONG_HTTP_PORT`, `API_EXTERNAL_URL`, and `SUPABASE_PUBLIC_URL` in `.env.local`
|
|
|
|
### Environment Variables Not Applied
|
|
|
|
If Docker reports warnings about missing variables, verify:
|
|
- The `--env-file` path is correct
|
|
- All required variables are set in `.env.local` (no empty values)
|
|
|
|
### Service Health
|
|
|
|
Check service status:
|
|
```bash
|
|
docker compose --env-file infra/env/.env.local -f infra/local/docker-compose.yml ps
|
|
```
|
|
|
|
View logs:
|
|
```bash
|
|
docker compose --env-file infra/env/.env.local -f infra/local/docker-compose.yml logs <service-name>
|
|
```
|
|
|
|
## Services
|
|
|
|
| Service | Description |
|
|
|------------|---------------------------------------|
|
|
| kong | API gateway (8001/8443) |
|
|
| studio | Supabase UI (via Kong) |
|
|
| auth | Authentication (GoTrue) |
|
|
| db | PostgreSQL database |
|
|
| rest | PostgREST API |
|
|
| realtime | Realtime subscriptions |
|
|
| storage | Storage API |
|
|
| functions | Edge functions |
|
|
| analytics | Logflare logging |
|
|
| vector | Log aggregator |
|
|
| supavisor | Database connection pooler |
|
|
| qdrant | Vector database |
|
|
| redis | Cache/message broker |
|
|
|
|
## Important Notes
|
|
|
|
- Never commit `.env.local` to version control
|
|
- Always use `--env-file` when running docker compose
|
|
- Port conflicts on Windows (especially 8000) can prevent Kong from starting
|
|
- Kong configuration is auto-generated from templates on container start
|