wvp-gb28181-project/docker/wvp/Dockerfile

79 lines
2.9 KiB
Docker
Raw Normal View History

2021-11-05 11:37:11 +08:00
FROM ubuntu:20.04 AS build
2021-11-05 20:02:58 +08:00
2021-11-05 20:25:29 +08:00
ARG gitUrl="https://gitee.com/18010473990"
ARG zlmGitUrl="https://gitee.com/xia-chu/ZLMediaKit"
2021-11-05 20:02:58 +08:00
RUN export DEBIAN_FRONTEND=noninteractive &&\
apt-get update && \
apt-get install -y --no-install-recommends openjdk-11-jre git maven nodejs npm build-essential \
2021-11-05 22:37:32 +08:00
cmake ca-certificates openssl ffmpeg
2021-11-05 20:02:58 +08:00
2021-11-05 22:37:32 +08:00
RUN cd /home && \
git clone "https://gitee.com/18010473990/maven.git" && \
2021-11-05 20:02:58 +08:00
cp maven/settings.xml /usr/share/maven/conf/ && \
2021-11-05 22:37:32 +08:00
git clone "${gitUrl}/wvp-GB28181.git" && \
git clone "${gitUrl}/wvp-pro-assist.git" && \
git clone --depth=1 "${zlmGitUrl}" && \
mkdir -p /opt/wvp/config /opt/assist/config /opt/media/www/record
2021-11-05 20:02:58 +08:00
2021-11-05 22:37:32 +08:00
RUN cd /home/wvp-GB28181/web_src && \
2021-11-05 20:02:58 +08:00
npm install && \
2021-11-05 22:37:32 +08:00
npm run build
2021-11-05 20:02:58 +08:00
2021-11-05 22:37:32 +08:00
RUN cd /home/wvp-GB28181 && \
2021-11-05 20:02:58 +08:00
mvn clean package -Dmaven.test.skip=true && \
cp /home/wvp-GB28181/target/*.jar /opt/wvp/ && \
2021-11-05 22:37:32 +08:00
cp /home/wvp-GB28181/src/main/resources/application-dev.yml /opt/wvp/config/application.yml
2021-11-05 20:02:58 +08:00
2021-11-05 22:37:32 +08:00
RUN cd /home/wvp-pro-assist && \
2021-11-05 20:02:58 +08:00
mvn clean package -Dmaven.test.skip=true && \
cp /home/wvp-pro-assist/target/*.jar /opt/assist/ && \
2021-11-05 22:37:32 +08:00
cp /home/wvp-pro-assist/src/main/resources/application-dev.yml /opt/assist/config/application.yml
2021-11-05 20:02:58 +08:00
2021-11-05 22:37:32 +08:00
RUN cd /home/ZLMediaKit && \
2021-11-05 20:02:58 +08:00
git submodule update --init --recursive && \
mkdir -p build release/linux/Release/ &&\
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j4 && \
rm -rf ../release/linux/Release/config.ini && \
2021-11-05 22:37:32 +08:00
cp -r ../release/linux/Release/* /opt/media
2021-11-05 20:02:58 +08:00
2021-11-05 22:37:32 +08:00
RUN cd /opt/wvp && \
2021-11-05 20:02:58 +08:00
echo '#!/bin/bash' > run.sh && \
echo 'echo ${WVP_IP}' >> run.sh && \
echo 'echo ${WVP_CONFIG}' >> run.sh && \
echo 'cd /opt/assist' >> run.sh && \
echo 'nohup java -jar *.jar --spring.config.location=/opt/assist/config/application.yml --userSettings.record=/opt/media/www/record/ --media.record-assist-port=18081 ${ASSIST_CONFIG} &' >> run.sh && \
echo 'nohup /opt/media/MediaServer -d -m 3 &' >> run.sh && \
echo 'cd /opt/wvp' >> run.sh && \
echo 'java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 ${WVP_CONFIG}' >> run.sh && \
chmod +x run.sh
FROM ubuntu:20.04
2021-11-05 11:37:11 +08:00
EXPOSE 18080/tcp
2021-11-05 20:02:58 +08:00
EXPOSE 5060/tcp
EXPOSE 5060/udp
EXPOSE 6379/tcp
EXPOSE 18081/tcp
EXPOSE 80/tcp
EXPOSE 1935/tcp
EXPOSE 554/tcp
EXPOSE 554/udp
EXPOSE 30000-30500/tcp
EXPOSE 30000-30500/udp
2021-11-05 22:37:32 +08:00
ENV LC_ALL zh_CN.UTF-8
2021-11-05 20:02:58 +08:00
RUN export DEBIAN_FRONTEND=noninteractive &&\
apt-get update && \
apt-get install -y --no-install-recommends openjdk-11-jre ca-certificates ffmpeg language-pack-zh-hans && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*dic
2021-11-05 11:37:11 +08:00
COPY --from=build /opt /opt
WORKDIR /opt/wvp
2021-11-05 20:02:58 +08:00
CMD ["sh", "run.sh"]