diff --git a/HealthMonitor.WebApi/Dockerfile b/HealthMonitor.WebApi/Dockerfile index 4deefd9..9bf5e19 100644 --- a/HealthMonitor.WebApi/Dockerfile +++ b/HealthMonitor.WebApi/Dockerfile @@ -25,8 +25,8 @@ WORKDIR /tmp/TDengine-client-3.0.4.2 RUN ls # 执行安装脚本 RUN bash install_client.sh -# 设置 TDengine 服务器的 End Point -RUN echo "firstEp 47.116.142.20:6030" >> /etc/taos/taos.cfg +## 设置 TDengine 服务器的 End Point +#RUN echo "firstEp 47.116.142.20:6030" >> /etc/taos/taos.cfg FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src @@ -51,12 +51,18 @@ RUN dotnet publish "HealthMonitor.WebApi.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -#ENV environment=Development +ENV environment=Development ENV urls=http://*:6899 ENV TimeZone=Asia/Shanghai ENV LANG C.UTF-8 RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone #ENTRYPOINT dotnet HealthMonitor.WebApi.dll --environment=$environment +ENV FirstEP=47.116.142.20:6030 +#ENV FirstEP=172.19.42.44:6030 +# 设置 TDengine 服务器的 End Point +#RUN echo "firstEp "$FirstEP >> /etc/taos/taos.cfg + +#ENTRYPOINT ["dotnet", "HealthMonitor.WebApi.dll"] +#CMD ["--environment=Development"] -ENTRYPOINT ["dotnet", "HealthMonitor.WebApi.dll"] -CMD ["--environment=Development"] \ No newline at end of file +CMD sh -c "echo 'firstEp $FirstEP' >> /etc/taos/taos.cfg && dotnet HealthMonitor.WebApi.dll --environment=$environment" diff --git a/health_monitor_run.sh b/health_monitor_run.sh index b74ca5f..dcd36ed 100644 --- a/health_monitor_run.sh +++ b/health_monitor_run.sh @@ -21,7 +21,7 @@ elif [[ ${environment} == 'test' || ${environment} == 'presure' ]]; then docker rm health_monitor || true docker rmi -f $(docker images | grep 139.224.254.18:5000/health_monitor | awk '{print $3}') docker pull 139.224.254.18:5000/health_monitor:$version - docker run --network=host -d -v /home/data/health_monitor/log:/var/health_monitor/logs --restart=always -e SKYWALKING__SERVICENAME=TEST::GpsCardGateway --name health_monitor 139.224.254.18:5000/health_monitor:$version --environment=${environment}; + docker run --network=host -d -v /home/data/health_monitor/log:/var/health_monitor/logs --restart=always -e FirstEP=172.19.42.44:6030 -e environment=test --name health_monitor 139.224.254.18:5000/health_monitor:$version; #删除产生的None镜像 docker rmi -f $(docker images | grep none | awk '{print $3}') docker ps -a