Compare commits
1 Commits
playground
...
7e49007d16
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e49007d16 |
28
Dockerfile
28
Dockerfile
@ -1,16 +1,29 @@
|
|||||||
# 引入SRS
|
# 引入SRS
|
||||||
FROM ossrs/srs:v6.0.155 AS srs
|
FROM ossrs/srs:v6.0.184 AS srs
|
||||||
|
|
||||||
# 前端构建阶段
|
# 前端构建阶段
|
||||||
FROM node:20-slim AS frontend-builder
|
FROM node:20-slim AS frontend-builder
|
||||||
|
ARG HTTP_PROXY=
|
||||||
|
ARG NO_PROXY=
|
||||||
|
ENV http_proxy=${HTTP_PROXY} \
|
||||||
|
https_proxy=${HTTP_PROXY} \
|
||||||
|
no_proxy=${NO_PROXY}
|
||||||
WORKDIR /app/frontend
|
WORKDIR /app/frontend
|
||||||
COPY html/NextGB/package*.json ./
|
COPY html/NextGB/package*.json ./
|
||||||
|
# RUN npm config set registry http://mirrors.cloud.tencent.com/npm/ \
|
||||||
|
# && npm install
|
||||||
RUN npm install
|
RUN npm install
|
||||||
COPY html/NextGB/ .
|
COPY html/NextGB/ .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# 后端构建阶段
|
# 后端构建阶段
|
||||||
FROM golang:1.23 AS backend-builder
|
FROM golang:1.23 AS backend-builder
|
||||||
|
ARG HTTP_PROXY=
|
||||||
|
ARG NO_PROXY=
|
||||||
|
ENV http_proxy=${HTTP_PROXY} \
|
||||||
|
https_proxy=${HTTP_PROXY} \
|
||||||
|
no_proxy=${NO_PROXY} \
|
||||||
|
GOPROXY=https://goproxy.cn,direct
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
@ -19,11 +32,20 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /app/srs-sip main/main.go
|
|||||||
|
|
||||||
# 最终运行阶段
|
# 最终运行阶段
|
||||||
FROM ubuntu:22.04
|
FROM ubuntu:22.04
|
||||||
|
ARG HTTP_PROXY=
|
||||||
|
ARG NO_PROXY=
|
||||||
|
ENV http_proxy=${HTTP_PROXY} \
|
||||||
|
https_proxy=${HTTP_PROXY} \
|
||||||
|
no_proxy=${NO_PROXY}
|
||||||
WORKDIR /usr/local
|
WORKDIR /usr/local
|
||||||
|
|
||||||
# 设置时区
|
# 设置时区
|
||||||
ENV TZ=Asia/Shanghai
|
ENV TZ=Asia/Shanghai
|
||||||
RUN apt-get update && \
|
RUN sed -i \
|
||||||
|
-e 's@http://archive.ubuntu.com/ubuntu/@http://mirrors.ustc.edu.cn/ubuntu/@g' \
|
||||||
|
-e 's@http://security.ubuntu.com/ubuntu/@http://mirrors.ustc.edu.cn/ubuntu/@g' \
|
||||||
|
/etc/apt/sources.list && \
|
||||||
|
apt-get update && \
|
||||||
apt-get install -y ca-certificates tzdata supervisor && \
|
apt-get install -y ca-certificates tzdata supervisor && \
|
||||||
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
|
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
|
||||||
dpkg-reconfigure -f noninteractive tzdata && \
|
dpkg-reconfigure -f noninteractive tzdata && \
|
||||||
@ -60,7 +82,7 @@ stderr_logfile=/dev/stderr\n\
|
|||||||
stderr_logfile_maxbytes=0\n\
|
stderr_logfile_maxbytes=0\n\
|
||||||
\n\
|
\n\
|
||||||
[program:srs-sip]\n\
|
[program:srs-sip]\n\
|
||||||
command=/usr/local/srs-sip/srs-sip\n\
|
command=/usr/local/srs-sip/srs-sip -c /usr/local/srs-sip/config.yaml\n\
|
||||||
directory=/usr/local/srs-sip\n\
|
directory=/usr/local/srs-sip\n\
|
||||||
autostart=true\n\
|
autostart=true\n\
|
||||||
autorestart=true\n\
|
autorestart=true\n\
|
||||||
|
|||||||
4530
GBT+28181-2022.md
Normal file
4530
GBT+28181-2022.md
Normal file
File diff suppressed because it is too large
Load Diff
4
README_cross.md
Normal file
4
README_cross.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose build --network host
|
||||||
|
```
|
||||||
@ -3,6 +3,11 @@ max_connections 1000;
|
|||||||
# For docker, please use docker logs to manage the logs of SRS.
|
# For docker, please use docker logs to manage the logs of SRS.
|
||||||
# See https://docs.docker.com/config/containers/logging/
|
# See https://docs.docker.com/config/containers/logging/
|
||||||
srs_log_tank console;
|
srs_log_tank console;
|
||||||
|
|
||||||
|
# srs_log_tank file;
|
||||||
|
# srs_log_file /var/log/srs/srs.log;
|
||||||
|
# ff_log_dir /var/log/srs;
|
||||||
|
|
||||||
daemon off;
|
daemon off;
|
||||||
disable_daemon_for_docker off;
|
disable_daemon_for_docker off;
|
||||||
http_api {
|
http_api {
|
||||||
|
|||||||
30
docker-compose.yml
Normal file
30
docker-compose.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
services:
|
||||||
|
srs-sip:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
network: host
|
||||||
|
args:
|
||||||
|
HTTP_PROXY: ${HTTP_PROXY:-}
|
||||||
|
NO_PROXY: "localhost,127.0.0.1,::1"
|
||||||
|
environment:
|
||||||
|
# CANDIDATE: ${CANDIDATE:-}
|
||||||
|
CANDIDATE: 192.168.2.184
|
||||||
|
TZ: "Asia/Shanghai"
|
||||||
|
volumes:
|
||||||
|
- ./run/conf/config.yaml:/usr/local/srs-sip/config.yaml:ro
|
||||||
|
- ./run/logs:/usr/local/srs-sip/logs
|
||||||
|
- ./run/srs/conf/srs.conf:/usr/local/srs/conf/srs.conf:ro
|
||||||
|
- ./run/srs/logs:/var/log/srs/
|
||||||
|
ports:
|
||||||
|
# SRS RTMP
|
||||||
|
- "1985:1985"
|
||||||
|
# SRS media ingest (GB28181 RTP/PS 等,取决于你的配置)
|
||||||
|
- "9000:9000"
|
||||||
|
# SRS WebRTC
|
||||||
|
- "8000:8000/udp"
|
||||||
|
# SIP
|
||||||
|
- "5060:5060"
|
||||||
|
- "5060:5060/udp"
|
||||||
|
# WebUI
|
||||||
|
- "8025:8025"
|
||||||
|
restart: unless-stopped
|
||||||
20
run/conf/config.yaml
Normal file
20
run/conf/config.yaml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# 通用配置
|
||||||
|
common:
|
||||||
|
# [debug, info, warn, error]
|
||||||
|
log-level: "info"
|
||||||
|
log-file: "logs/srs-sip.log"
|
||||||
|
|
||||||
|
# GB28181配置
|
||||||
|
gb28181:
|
||||||
|
serial: "34020000002000000001"
|
||||||
|
realm: "3402000000"
|
||||||
|
host: "0.0.0.0"
|
||||||
|
port: 5060
|
||||||
|
auth:
|
||||||
|
enable: false
|
||||||
|
password: "123456"
|
||||||
|
|
||||||
|
# HTTP服务配置
|
||||||
|
http:
|
||||||
|
listen: 8025
|
||||||
|
dir: ./html
|
||||||
60
run/srs/conf/srs.conf
Normal file
60
run/srs/conf/srs.conf
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
listen 1935;
|
||||||
|
max_connections 1000;
|
||||||
|
# For docker, please use docker logs to manage the logs of SRS.
|
||||||
|
# See https://docs.docker.com/config/containers/logging/
|
||||||
|
srs_log_tank console;
|
||||||
|
daemon off;
|
||||||
|
disable_daemon_for_docker off;
|
||||||
|
http_api {
|
||||||
|
enabled on;
|
||||||
|
listen 1985;
|
||||||
|
raw_api {
|
||||||
|
enabled on;
|
||||||
|
allow_reload on;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
http_server {
|
||||||
|
enabled on;
|
||||||
|
listen 8080;
|
||||||
|
dir ./objs/nginx/html;
|
||||||
|
}
|
||||||
|
|
||||||
|
stream_caster {
|
||||||
|
enabled on;
|
||||||
|
caster gb28181;
|
||||||
|
output rtmp://127.0.0.1/live/[stream];
|
||||||
|
listen 9000;
|
||||||
|
sip {
|
||||||
|
enabled off;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rtc_server {
|
||||||
|
enabled on;
|
||||||
|
listen 8000; # UDP port
|
||||||
|
# @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate
|
||||||
|
candidate $CANDIDATE;
|
||||||
|
# Disable for Oryx.
|
||||||
|
use_auto_detect_network_ip off;
|
||||||
|
api_as_candidates off;
|
||||||
|
}
|
||||||
|
|
||||||
|
vhost __defaultVhost__ {
|
||||||
|
http_remux {
|
||||||
|
enabled on;
|
||||||
|
mount [vhost]/[app]/[stream].flv;
|
||||||
|
}
|
||||||
|
rtc {
|
||||||
|
enabled on;
|
||||||
|
nack on;
|
||||||
|
twcc on;
|
||||||
|
stun_timeout 30;
|
||||||
|
dtls_role passive;
|
||||||
|
# @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtmp-to-rtc
|
||||||
|
rtmp_to_rtc on;
|
||||||
|
keep_bframe off;
|
||||||
|
# @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtc-to-rtmp
|
||||||
|
rtc_to_rtmp on;
|
||||||
|
pli_for_rtmp 6.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user