| | |
| | | FROM ubuntu:20.04 AS build |
| | | |
| | | # DEBIAN_FRONTEND这个环境变量,告知操作系统应该从哪儿获得用户输入。 |
| | | # 如果设置为”noninteractive”,你就可以直接运行命令,而无需向用户请求输入(所有操作都是非交互式的)。 |
| | | ARG DEBIAN_FRONTEND=noninteractive |
| | | ENV TZ=Asia/Shanghai |
| | | |
| | |
| | | |
| | | RUN git clone https://gitee.com/pan648540858/maven.git && \ |
| | | cp maven/settings.xml /usr/share/maven/conf/ && \ |
| | | git clone https://gitee.com/pan648540858/wvp-GB28181-pro.git && \ |
| | | git clone https://gitee.com/pan648540858/wvp-GB28181.git && \ |
| | | git clone https://gitee.com/pan648540858/wvp-pro-assist.git |
| | | # 编译前端界面 |
| | | WORKDIR /home/wvp-GB28181-pro/web_src |
| | | WORKDIR /home/wvp-GB28181/web_src |
| | | |
| | | RUN npm install && \ |
| | | npm run build && \ |
| | | mkdir -p /opt/wvp/config && \ |
| | | mkdir -p /opt/assist/config && \ |
| | | cp /home/wvp-GB28181-pro/src/main/resources/application-docker.yml /opt/wvp/config/application.yml && \ |
| | | cp /home/wvp-GB28181/src/main/resources/application-dev.yml /opt/wvp/config/application.yml && \ |
| | | cp /home/wvp-pro-assist/src/main/resources/application-dev.yml /opt/assist/config/application.yml |
| | | |
| | | # wvp打包 |
| | | WORKDIR /home/wvp-GB28181-pro |
| | | WORKDIR /home/wvp-GB28181 |
| | | RUN mvn compile && \ |
| | | mvn package && \ |
| | | cp /home/wvp-GB28181-pro/target/wvp*.jar /opt/wvp/ |
| | | cp /home/wvp-GB28181/target/wvp*.jar /opt/wvp/ |
| | | |
| | | # wvp 录像管理打包 |
| | | WORKDIR /home/wvp-pro-assist |
| | |
| | | |
| | | # 清理 |
| | | RUN rm -rf /home/wiki && \ |
| | | rm -rf /home/wvp-GB28181-pro && \ |
| | | rm -rf /home/wvp-GB28181 && \ |
| | | apt-get autoremove -y git maven nodejs npm && \ |
| | | apt-get clean -y && \ |
| | | rm -rf /var/lib/apt/lists/*dic |
| | |
| | | echo 'nohup /opt/media/MediaServer -d -m 3 &' >> run.sh && \ |
| | | echo 'cd /opt/wvp' >> run.sh && \ |
| | | echo 'if [${WVP_CONFIG}]; then' >> run.sh && \ |
| | | echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 ${WVP_CONFIG}' >> run.sh && \ |
| | | echo ' java -jar *.jar --spring.confi g.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 ${WVP_CONFIG}' >> run.sh && \ |
| | | echo 'else' >> run.sh && \ |
| | | echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 --media.ip=127.0.0.1 --media.hook-ip=127.0.0.1 --media.sdp-ip=${WVP_IP} --sip.ip=${WVP_IP} --media.stream-ip=${WVP_IP}' >> run.sh && \ |
| | | echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 --media.ip=127.0.0.1 --media.sdp-ip=${WVP_IP} --sip.ip=${WVP_IP} --media.stream-ip=${WVP_IP}' >> run.sh && \ |
| | | echo 'fi' >> run.sh |
| | | RUN chmod +x run.sh |
| | | |