feat: add Windows-first deployment flow
This commit is contained in:
1 parent
7353d140b8
commit
da01967c2e
5 files changed
+176
-31
No files matched your search
+63
-14
@@ -1,20 +1,69 @@
|
||||
# Deployment
|
||||
|
||||
All runtime paths are resolved relative to the repository by default and can be overridden with environment variables.
|
||||
The maintained deployment target for this project is Windows first. Linux and macOS can still run services manually, but real end-to-end deployment testing should use the PowerShell flow below.
|
||||
|
||||
- `LS_DATABASE_URL`: SQLAlchemy database URL.
|
||||
- `LS_REPLAY_MEDIA_DIR`: server-local directory containing replay files.
|
||||
Runtime paths are resolved relative to the repository by default and can be overridden with environment variables.
|
||||
|
||||
- LS_DATABASE_URL: SQLAlchemy database URL.
|
||||
- LS_REPLAY_MEDIA_DIR: server-local directory containing replay files. When started by start.ps1, the default is runtime\replay under the repository.
|
||||
- LS_HLS_RUNTIME_DIR: backend and FFmpeg HLS output directory. When started by start.ps1, the default is runtime\hls under the repository.
|
||||
|
||||
## Windows deployment
|
||||
|
||||
Run these commands from PowerShell on the Windows node.
|
||||
|
||||
### 1. Install prerequisites
|
||||
|
||||
Required on PATH: Python 3.11+, Node.js LTS with npm, FFmpeg, and MediaMTX unless starting with -NoMediaMTX. Optional for GPU verification: NVIDIA driver and nvidia-smi.
|
||||
|
||||
### 2. Install application dependencies
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass -File .\start.ps1 -InstallDeps -NoMediaMTX
|
||||
```
|
||||
|
||||
### 3. Start the full Windows stack
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass -File .\start.ps1
|
||||
```
|
||||
|
||||
This starts MediaMTX origin, FastAPI backend on 0.0.0.0:8080, Vite frontend on 0.0.0.0:5173, HLS output under runtime\hls, and logs under runtime\logs.
|
||||
|
||||
Open backend docs at http://127.0.0.1:8080/docs and frontend UI at http://127.0.0.1:5173/. Publish RTMP to rtmp://127.0.0.1:1935/live/<stream_key>. MediaMTX HLS is http://127.0.0.1:8888/<stream_key>/index.m3u8.
|
||||
|
||||
### 4. Useful Windows variants
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass -File .\start.ps1 -NoMediaMTX
|
||||
powershell -ExecutionPolicy Bypass -File .\start.ps1 -NoFrontend
|
||||
powershell -ExecutionPolicy Bypass -File .\start.ps1 -HostAddress 0.0.0.0 -BackendPort 8080 -FrontendPort 5173
|
||||
```
|
||||
|
||||
### 5. Smoke test commands
|
||||
|
||||
```powershell
|
||||
curl.exe -I http://127.0.0.1:5173/
|
||||
curl.exe http://127.0.0.1:8080/api/health
|
||||
ffmpeg -version
|
||||
mediamtx --version
|
||||
nvidia-smi
|
||||
```
|
||||
|
||||
If browser or network tests run from another machine, open the Windows firewall for ports 5173, 8080, 1935, and 8888.
|
||||
|
||||
## Edge node scripts
|
||||
|
||||
```cmd
|
||||
mediamtx\scripts\start_origin.bat
|
||||
mediamtx\scripts\start_edge.bat 1 127.0.0.1
|
||||
mediamtx\scripts\check_multicast.bat
|
||||
```
|
||||
|
||||
## Replay file safety
|
||||
|
||||
Replay records store paths relative to LS_REPLAY_MEDIA_DIR. Absolute paths and parent-directory traversal are rejected.
|
||||
|
||||
## Linux and macOS
|
||||
|
||||
Run `./start.sh`. The script resolves its own directory and does not depend on `/workspace`.
|
||||
|
||||
## Windows
|
||||
|
||||
1. Create a virtual environment with `py -m venv backend\.venv`.
|
||||
2. Install dependencies with `backend\.venv\Scripts\pip install -r backend\requirements.txt`.
|
||||
3. Optionally set `LS_REPLAY_MEDIA_DIR` to an absolute media directory.
|
||||
4. Run `powershell -ExecutionPolicy Bypass -File .\start.ps1`.
|
||||
5. In another terminal, run `npm install` and `npm run dev` from `frontend`.
|
||||
|
||||
Replay records store paths relative to `LS_REPLAY_MEDIA_DIR`. Absolute paths and parent-directory traversal are rejected.
|
||||
Linux and macOS are not the primary deployment path. For local development, run the backend with uvicorn from backend, run the frontend with npm run dev from frontend, and set LS_HLS_RUNTIME_DIR to a writable directory.
|
||||
Reference in new issue
Block a user