diff --git a/README.md b/README.md index 2aa4873..0cd63d4 100644 --- a/README.md +++ b/README.md @@ -45,3 +45,28 @@ docker run --name gb28181-mocking --rm \ mvn deploy -DaltDeploymentRepository=amleixun-mvn-reop::default::file:H:/Repository/skcks.cn/gb28181-docking-platform-mvn-repo ``` git push 推送即可 + +### 关于外置 ffmpeg 部分 +项目仓库中自带一个 linux amd64 ffmpeg 用于docker打包 + +如果有其他平台需要可 修改位于 gb28181-mocking-starter 的 Dockerfile 文件 + +#### linux +linux 各发行版本可使用对应 官方源 安装 +或者根据不同平台使用 https://www.johnvansickle.com/ffmpeg/ 提供的免编译版本 +例: + +amd64: https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz + +arm64: https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-arm64-static.tar.xz + +#### windows +可到 ffmpeg.org 官网查找 + +或 到 github https://github.com/BtbN/FFmpeg-Builds/releases + +下载对应版本 + +例: + +win64: https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip diff --git a/ffmpeg/ffmpeg-git-amd64-static.tar.xz b/ffmpeg/ffmpeg-git-amd64-static.tar.xz new file mode 100644 index 0000000..8a49888 Binary files /dev/null and b/ffmpeg/ffmpeg-git-amd64-static.tar.xz differ diff --git a/gb28181-mocking-starter/Dockerfile b/gb28181-mocking-starter/Dockerfile index be8dd4f..fe169b5 100644 --- a/gb28181-mocking-starter/Dockerfile +++ b/gb28181-mocking-starter/Dockerfile @@ -6,6 +6,11 @@ ENV HOME_PATH /opt/gb28181-docking-platform-mocking/ RUN mkdir -p $HOME_PATH WORKDIR $HOME_PATH +RUN mkdir -p /usr/bin/ffmpeg +ADD ../ffmpeg/ffmpeg /usr/bin/ffmpeg/ffmpeg +ADD ../ffmpeg/ffprobe /usr/bin/ffmpeg/ffprobe +ADD ../ffmpeg/model /usr/bin/ffmpeg/model + ADD target/gb28181-mocking-starter.jar /opt/gb28181-docking-platform-mocking/starter.jar EXPOSE 18182 diff --git a/gb28181-mocking-starter/src/main/resources/application.yml b/gb28181-mocking-starter/src/main/resources/application.yml index dab5bc1..81fe43b 100644 --- a/gb28181-mocking-starter/src/main/resources/application.yml +++ b/gb28181-mocking-starter/src/main/resources/application.yml @@ -24,8 +24,8 @@ spring: username: root password: 123456a url: jdbc:mysql://192.168.1.241:3306/gb28181_docking_platform?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai - profiles: - active: local +# profiles: +# active: local gb28181: # 作为28181服务器的配置 diff --git a/package-docker.sh b/package-docker.sh index 708984e..21359b7 100644 --- a/package-docker.sh +++ b/package-docker.sh @@ -2,6 +2,13 @@ # 用于缓存打包过程下载的依赖 mkdir repository curDir=`pwd` + if ! test -e ffmpeg/ffmpeg;then + xz -d ffmpeg/ffmpeg-git-amd64-static.tar.xz + tar -xvf ffmpeg-git-amd64-static.tar -C ./ + mv ffmpeg-git*-static/* ./ + rm -rf ffmpeg-git*-static +fi + docker run --name maven --rm \ -v ${curDir}:/usr/src/mymaven \ -v ${curDir}/repository:/root/.m2/repository \