mirror of
https://gitlab.com/vyla-entertainment/documentation.git
synced 2026-11-16 15:37:23 -05:00
rewrite
This commit is contained in:
@@ -13,11 +13,13 @@ Stream API can be self-hosted on any Linux VPS, home server, or container enviro
|
||||
Configure environment variables via a `.env` file in the project root:
|
||||
|
||||
- `PORT` *(number, optional)* — Bind port. Default: `7860`.
|
||||
- `WORKER_COUNT` *(number, optional)* — Number of cluster workers. Default: `1`.
|
||||
- `TMDB_API_KEY` *(string, recommended)* — TMDB v3 API key for metadata lookups.
|
||||
- `WORKER_COUNT` *(number, optional)* — Number of cluster workers. Default: available CPU count.
|
||||
- `ENABLE_DEBUG_ROUTE` *(boolean, optional)* — Enables `/debug/:source`. Keep `false` in production.
|
||||
- `FALLBACK_BASE` *(string, optional)* — Secondary Stream API URL for failover redirects.
|
||||
- `IS_HF` *(boolean, optional)* — Enables HuggingFace Spaces compatibility.
|
||||
- `PROXY_STREAMS` *(boolean, optional)* — Enable local media stream proxying. Default: `true`.
|
||||
- `PROXY_URL` *(string, optional)* — Base URL of an external proxy server if offloading stream bandwidth.
|
||||
- `ENABLE_DEBUG_ROUTE` *(boolean, optional)* — Enables `/api/debug/:id`. Keep `false` in production.
|
||||
- `GA_MEASUREMENT_ID` *(string, optional)* — Google Analytics measurement ID for request metrics.
|
||||
- `GA_API_SECRET` *(string, optional)* — Google Analytics measurement protocol API secret.
|
||||
|
||||
---
|
||||
|
||||
@@ -25,20 +27,12 @@ Configure environment variables via a `.env` file in the project root:
|
||||
|
||||
### Dockerfile
|
||||
```dockerfile
|
||||
FROM node:20-alpine
|
||||
|
||||
FROM node:22-slim
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk add --no-cache python3 make g++
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
COPY package.json .
|
||||
RUN npm install
|
||||
COPY . .
|
||||
|
||||
ENV PORT=7860
|
||||
EXPOSE 7860
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
```
|
||||
|
||||
@@ -57,6 +51,7 @@ services:
|
||||
- PORT=7860
|
||||
- TMDB_API_KEY=your_tmdb_api_key_here
|
||||
- WORKER_COUNT=4
|
||||
- PROXY_STREAMS=true
|
||||
- ENABLE_DEBUG_ROUTE=false
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
@@ -80,7 +75,7 @@ docker compose up -d
|
||||
```bash
|
||||
git clone https://gitlab.com/vyla-entertainment/stream-api.git /opt/stream-api
|
||||
cd /opt/stream-api
|
||||
npm ci --omit=dev
|
||||
npm install --omit=dev
|
||||
```
|
||||
|
||||
### 2. Service File: `/etc/systemd/system/stream-api.service`
|
||||
@@ -100,6 +95,7 @@ Environment=NODE_ENV=production
|
||||
Environment=PORT=7860
|
||||
Environment=TMDB_API_KEY=your_tmdb_api_key_here
|
||||
Environment=WORKER_COUNT=4
|
||||
Environment=PROXY_STREAMS=true
|
||||
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
|
||||
Reference in New Issue
Block a user