Docker Deployment
Docker is the easiest and recommended way to deploy Rust-Srec.
Prerequisites
Quick Start
One-Line Install (Linux/macOS)
Run this command to automatically set up Rust-Srec:
curl -fsSL https://docs.srec.rs/docker-install.sh | bashOne-Line Install (Windows PowerShell)
irm https://docs.srec.rs/install.ps1 | iexThe scripts will:
- Download configuration files
- Generate secure secrets automatically
- Optionally start the application
Customizing Installation
The script auto-detects your system language. You can also customize the installation using environment variables:
Linux/macOS:
# Install dev version to custom directory
RUST_SREC_DIR=/opt/rust-srec VERSION=dev curl -fsSL https://docs.srec.rs/docker-install.sh | bashWindows PowerShell:
# Install dev version to custom directory
$env:RUST_SREC_DIR = "C:\rust-srec"; $env:VERSION = "dev"; irm https://docs.srec.rs/install.ps1 | iex| Variable | Description | Default |
|---|---|---|
SREC_LANG | Language (zh or en) | Auto-detect |
RUST_SREC_DIR | Installation directory | ./rust-srec |
VERSION | Docker image tag (latest or dev) | latest |
Manual Setup
Create a project directory:
bashmkdir rust-srec && cd rust-srecDownload the example configuration files:
Rename the files:
bash# On Linux/macOS mv docker-compose.example.yml docker-compose.yml mv .env.example .env # On Windows rename docker-compose.example.yml docker-compose.yml rename .env.example .envEdit
.env: Make sure to set a secureJWT_SECRETandSESSION_SECRET(at least 32 characters).
Security Note
You can generate a secure random string using:
- Linux/macOS:
openssl rand -hex 32 - Windows (PowerShell):
$bytes = New-Object Byte[] 32; [Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($bytes); -join ($bytes | ForEach-Object { "{0:x2}" -f $_ })
- Start the application:bash
docker-compose up -d
Data Persistence
Ensure your DATA_DIR and OUTPUT_DIR are on a drive with sufficient space. Streaming recordings can consume disk space very quickly.
Configuration
The .env file contains all the necessary environment variables.
| Variable | Description |
|---|---|
JWT_SECRET | Secret key for JWT signing (Required) |
SESSION_SECRET | Secret for frontend session encryption (Required) |
Full Reference
For a complete list of all available environment variables and their descriptions, see the Environment Variables Reference.
docker-compose.yml
Our standard example includes:
- Automatic Restart:
unless-stopped - Healthchecks: Ensures the frontend only starts after the backend is ready
- Resource Limits: Configurable CPU and memory limits
- Log Rotation: Prevents logs from filling up your disk
Proxy Configuration
If you are behind a corporate proxy or in a region with restricted access, you can configure proxy settings for both the application and the download engines.
1. Configure Environment Variables
Add HTTP_PROXY and HTTPS_PROXY to your .env file:
# .env
HTTP_PROXY=http://your-proxy-host:port
HTTPS_PROXY=http://your-proxy-host:port
NO_PROXY=localhost,127.0.0.1,rust-srec2. Update docker-compose.yml
Ensure these variables are passed to the rust-srec service:
services:
rust-srec:
# ...
environment:
- HTTP_PROXY=${HTTP_PROXY:-}
- HTTPS_PROXY=${HTTPS_PROXY:-}
- NO_PROXY=${NO_PROXY:-}
# ...3. Enable in Application Settings
After starting the application, go to Global Settings > Downloader > Proxy:
- Enable Proxy.
- Check Use System Proxy.
- Save settings.
This will instruct the application and its engines (FFmpeg, Streamlink, Mesio) to respect the environment variables you configured.
Accessing the Application
- Web Interface:
http://localhost:[FRONTEND_PORT](Default: http://localhost:15275) - API reference:
http://localhost:[API_PORT]/api/docs(Default: http://localhost:12555/api/docs)
Updating
To update to the latest version:
docker-compose pull
docker-compose up -d