44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# SRS 流媒体服务器
|
|
srs:
|
|
image: ossrs/srs:5
|
|
container_name: srs-server
|
|
ports:
|
|
- "${SRS_RTMP_EXPOSE_PORT:-25002}:1935" # RTMP 推流端口
|
|
- "${SRS_HTTP_EXPOSE_PORT:-25003}:8080" # HTTP-FLV/HLS 播放端口
|
|
- "${SRS_API_EXPOSE_PORT:-1985}:1985" # SRS API 端口(内部使用)
|
|
volumes:
|
|
- ./docker/srs/srs.conf:/usr/local/srs/conf/srs.conf
|
|
restart: unless-stopped
|
|
networks:
|
|
- live-network
|
|
|
|
# API 服务器
|
|
api-server:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: api-server
|
|
ports:
|
|
- "${API_EXPOSE_PORT:-25001}:3001"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=3001
|
|
- SRS_HOST=srs
|
|
- SRS_RTMP_PORT=1935
|
|
- SRS_HTTP_PORT=8080
|
|
- PUBLIC_SRS_HOST=${PUBLIC_SRS_HOST:-localhost}
|
|
- PUBLIC_SRS_RTMP_PORT=${PUBLIC_SRS_RTMP_PORT:-${SRS_RTMP_EXPOSE_PORT:-25002}}
|
|
- PUBLIC_SRS_HTTP_PORT=${PUBLIC_SRS_HTTP_PORT:-${SRS_HTTP_EXPOSE_PORT:-25003}}
|
|
depends_on:
|
|
- srs
|
|
restart: unless-stopped
|
|
networks:
|
|
- live-network
|
|
|
|
networks:
|
|
live-network:
|
|
driver: bridge
|