Ver código fonte

调整启动参数

td_orm
H Vs 1 ano atrás
pai
commit
3831dce31a
2 arquivos alterados com 12 adições e 6 exclusões
  1. +11
    -5
      HealthMonitor.WebApi/Dockerfile
  2. +1
    -1
      health_monitor_run.sh

+ 11
- 5
HealthMonitor.WebApi/Dockerfile Ver arquivo

@@ -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"]
CMD sh -c "echo 'firstEp $FirstEP' >> /etc/taos/taos.cfg && dotnet HealthMonitor.WebApi.dll --environment=$environment"

+ 1
- 1
health_monitor_run.sh Ver arquivo

@@ -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


Carregando…
Cancelar
Salvar