Skip to content

Commit 2655b8a

Browse files
jss-tgipcjs
andauthored
perf: 一般不使用DOCKER_DIR变量, 优先使用相对路径 (#53)
* perf: 一般不使用DOCKER_DIR变量, 优先使用相对路径 * wip: typo * wip: typo --------- Co-authored-by: ipcjs.mac4 <gipcjs@gmail.com>
1 parent 86fbf5c commit 2655b8a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mkdir /data
2020
git clone https://github.com/TranscodeGroup/docker.git /home/docker
2121
```
2222

23-
### 2. 配置`compse.yaml`
23+
### 2. 配置`compose.yaml`
2424

2525
创建`/home/docker-compose/compose.yaml`文件, 参考如下示例:
2626

default.en.env

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## ================================ Directory ================================
22

3+
# Docker repository directory. For files inside the docker repository, relative paths are mostly used, so referencing this absolute path is generally not necessary.
4+
DOCKER_DIR=/home/docker
35
# Data directory, used for storing logs/database/files, etc.
46
DATA_DIR=/data
5-
# Docker repository directory. It is not recommended to reference the absolute path of the docker repository in the compose file. It is recommended to use configs instead: https://docs.docker.com/reference/compose-file/configs/
6-
DOCKER_DIR=/home/docker
7-
# Project configuration directory
7+
# Configuration directory, used for storing configuration files. It is recommended to use git to manage this directory.
88
DOCKER_COMPOSE_DIR=/home/docker-compose
99
# bus frontend file override directory. Files in this directory will be copied to the bus frontend directory when compose is up. Usually, the following files can be overridden:
1010
# - _app.config.js: Frontend configuration file
@@ -41,7 +41,7 @@ SERVER_HOSTNAME='' # livedvr.tripsdd.com
4141
# Required, absolute path of the certificate file, excluding .crt/.key suffix. nginx actually reads the two files ${SSL_CERTIFICATE}.crt and ${SSL_CERTIFICATE}.key
4242
# If using http, or using https but no certificate has been applied for temporarily, it can be set to the built-in fake certificate: /home/docker/nginx/ssl/placeholder
4343
# If using crotbot to automatically apply for a certificate, you need to start it separately first (docker compose up crotbot). The applied certificate path will be printed in the log, and then add it to the variable, generally: /data/certbot/live/${SERVER_HOSTNAME}/certificate,
44-
SSL_CERTIFICATE='/home/docker/nginx/ssl/placeholder'
44+
SSL_CERTIFICATE=${DOCKER_DIR}/nginx/ssl/placeholder # /home/docker/nginx/ssl/placeholder
4545

4646
# When bus and track are deployed on the same server, they need to be distinguished by domain name
4747
BUS_HOSTNAME=${SERVER_HOSTNAME}

default.env

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## ================================ 目录 ================================
22

3+
# docker仓库的目录, 在docker仓库内部的文件, 大部分时候使用相对路径就行了, 一般不需要引用这个绝对路径
4+
DOCKER_DIR=/home/docker
35
# 数据目录, 用于存放日志/数据库/文件等
46
DATA_DIR=/data
5-
# docker仓库的目录, 不建议在compose文件中引用docker仓库的绝对路径, 建议使用configs替代: https://docs.docker.com/reference/compose-file/configs/
6-
DOCKER_DIR=/home/docker
7-
# 实际配置项目配置目录
7+
# 配置目录, 用于存放配置文件, 建议使用git管理该目录
88
DOCKER_COMPOSE_DIR=/home/docker-compose
99
# bus前端文件复写目录, 该目录中的文件会在compose被up时被复制到bus前端目录, 通常可以复写如下文件:
1010
# - _app.config.js: 前端配置文件
@@ -41,7 +41,7 @@ SERVER_HOSTNAME='' # livedvr.tripsdd.com
4141
# 必填, 证书文件的绝对路径, 排除.crt/.key后缀, nginx实际读取的是 ${SSL_CERTIFICATE}.crt 和 ${SSL_CERTIFICATE}.key 两个文件
4242
# 如果使用http, 或者使用https但暂时没有申请到证书, 可以设置成内置的假证书: /home/docker/nginx/ssl/placeholder
4343
# 若使用crotbot自动申请证书, 需要先单独启动一次(docker compose up crotbot), 申请到的证书路径会在日志中打印, 然后将它添加到变量中, 一般为: /data/certbot/live/${SERVER_HOSTNAME}/certificate,
44-
SSL_CERTIFICATE='/home/docker/nginx/ssl/placeholder'
44+
SSL_CERTIFICATE=${DOCKER_DIR}/nginx/ssl/placeholder # /home/docker/nginx/ssl/placeholder
4545

4646
# bus和track部署在同一台服务器上时, 需要通过域名区分两者
4747
BUS_HOSTNAME=${SERVER_HOSTNAME}

video/compose.storage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
srs:
33
volumes:
4-
- "${DOCKER_DIR:-/home/docker}/video/srs-storage/conf:/usr/local/srs/conf"
4+
- "./srs-storage/conf:/usr/local/srs/conf"
55
- "${DATA_DIR:-/data}/srs-storage/html:/usr/local/srs/objs/nginx/html"
66
rtp:
77
volumes:

video/compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
# http-flv/hls端口,建议nginx代理, 内部别名访问
1111
#- 8080:8080
1212
volumes:
13-
- "${DOCKER_DIR:-/home/docker}/video/srs/conf:/usr/local/srs/conf"
13+
- "./srs/conf:/usr/local/srs/conf"
1414
- "${DATA_DIR:-/data}/srs/html:/usr/local/srs/objs/nginx/html"
1515
ulimits:
1616
nproc: 65535

0 commit comments

Comments
 (0)