提交 e685911a 编写于 作者: ibiz4j's avatar ibiz4j

删除 swarm.yaml.ftl

上级 60273655
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()?? && sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()??>
<#assign httpPort = "8080">
<#assign nacosUrl = "127.0.0.1:8848" >
<#assign redisHost = "127.0.0.1" >
<#assign redisPort = "6379" >
<#assign redisDataBase = "0" >
<#assign dbUserName="root">
<#assign dbPassWord="123456">
<#assign dbUrl="jdbc:mysql://127.0.0.1:3306/"+sys.name+"?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true">
<#assign dbDriver="com.mysql.jdbc.Driver">
<#assign dockerPortMap="">
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()??>
<#assign depApp=sysrun.getPSDevSlnMSDepApp()>
<#if depApp.getHttpPort()??>
<#assign httpPort = sysrun.getPSDevSlnMSDepApp().getHttpPort()?c>
</#if>
<#if depApp.getPSDCMSPlatformNode()??>
<#assign appPlatformNode=depApp.getPSDCMSPlatformNode()>
<#assign appPlatform=depApp.getPSDCMSPlatform()>
<#if appPlatform.getUserParam("nacos","127.0.0.1:8848")??>
<#assign nacosUrl = appPlatform.getUserParam("nacos","127.0.0.1:8848")>
</#if>
<#if appPlatformNode.getLocalSSHPort()??>
<#assign httpPort = appPlatformNode.getLocalSSHPort()?c>
</#if>
<#if depApp.getUserParam("spring.redis.host","")?? && depApp.getUserParam("spring.redis.host","")!="">
<#assign redisHost = depApp.getUserParam("spring.redis.host","")>
<#elseif appPlatform.getUserParam("spring.redis.host","")?? && appPlatform.getUserParam("spring.redis.host","")!="">
<#assign redisHost = appPlatform.getUserParam("spring.redis.host","")>
</#if>
<#if depApp.getUserParam("spring.redis.port","")?? && depApp.getUserParam("spring.redis.port","")!="">
<#assign redisPort = depApp.getUserParam("spring.redis.port","")>
<#elseif appPlatform.getUserParam("spring.redis.port","")?? && appPlatform.getUserParam("spring.redis.port","")!="">
<#assign redisPort = appPlatform.getUserParam("spring.redis.port","")>
</#if>
<#if depApp.getUserParam("spring.redis.database","")?? && depApp.getUserParam("spring.redis.database","")!="">
<#assign redisDataBase = depApp.getUserParam("spring.redis.database","")>
<#elseif appPlatform.getUserParam("spring.redis.database","")?? && appPlatform.getUserParam("spring.redis.database","")!="">
<#assign redisDataBase = appPlatform.getUserParam("spring.redis.database","")>
</#if>
<#if depApp.getUserParam("portmap","")?? && depApp.getUserParam("portmap","")!="">
<#assign dockerPortMap = depApp.getUserParam("portmap","")>
<#elseif appPlatform.getUserParam("portmap","")?? && appPlatform.getUserParam("portmap","")!="">
<#assign dockerPortMap = appPlatform.getUserParam("portmap","")>
</#if>
</#if>
</#if>
<#comment>数据库配置</#comment>
<#if sysrun.getPSDBDevInst()??>
<#assign sysRunDBInst = sysrun.getPSDBDevInst()>
<#assign dbUserName=sysRunDBInst.getUserName()>
<#assign dbPassWord=sysRunDBInst.getPassword()>
<#assign dbUrl=sysRunDBInst.getConnUrl()>
<#if (sysRunDBInst.getDBType()=='MYSQL5')>
<#assign dbDriver="com.mysql.jdbc.Driver">
<#assign dbUrl=dbUrl+"&allowMultiQueries=true">
<#elseif (sysRunDBInst.getDBType()=='DB2')>
<#assign dbDriver="com.ibm.db2.jcc.DB2Driver">
<#elseif (sysRunDBInst.getDBType()=='ORACLE')>
<#assign dbDriver="oracle.jdbc.driver.OracleDriver">
<#elseif (sysRunDBInst.getDBType()=='SQLSERVER')>
<#assign dbDriver="com.microsoft.sqlserver.jdbc.SQLServerDriver">
<#elseif (sysRunDBInst.getDBType()=='POSTGRESQL')>
<#assign dbDriver="org.postgresql.Driver">
<#elseif (sysRunDBInst.getDBType()=='PPAS')>
<#assign dbDriver="com.edb.Driver">
</#if>
</#if>
version: "3.2"
services:
${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}:
image: dstimage
ports:
- "${httpPort}:${httpPort}"
<#if dockerPortMap!=''>
- "${dockerPortMap}"
</#if>
networks:
- agent_network
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()?? && sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()??>
<#assign depApp=sysrun.getPSDevSlnMSDepApp()>
<#assign appPlatformNode=sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()>
<#assign appPlatform=sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatform()>
#logging:
# driver: loki
# options:
# loki-url: "http://172.16.240.111:3100/loki/api/v1/push"
# max-size: "50m"
# max-file: "10"
environment:
<#if appPlatformNode.getSSHIPAddr()?? && appPlatformNode.getSSHIPAddr()!=''>
- SPRING_CLOUD_NACOS_DISCOVERY_IP=${appPlatformNode.getSSHIPAddr()}
</#if>
<#if appPlatform.getPSDCCluster()?? && appPlatform.getPSDCCluster().getLocalSSHIPAddr()!=''>
- SPRING_CLOUD_NACOS_DISCOVERY_IP=${appPlatform.getPSDCCluster().getLocalSSHIPAddr()}
</#if>
<#comment>系统运行参数设置,从SysRun中获取到当前部署相关信息</#comment>
- SERVER_PORT=${httpPort}
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=${nacosUrl}
- SPRING_CLOUD_NACOS_CONFIG_SERVER-ADDR=${nacosUrl}
- SPRING_APPLICATION_NAME=<#if sys.getDeploySysId()??><#if (sys.getDeploySysId()?length gt 16)>${sys.getName()?lower_case}<#else>${sys.getDeploySysId()?lower_case}</#if><#else>${sys.getName()?lower_case}</#if>-${app.getPKGCodeName()?lower_case}
- IBIZ_GATEWAY_PREFIX=<#if sys.getDeploySysId()??><#if (sys.getDeploySysId()?length gt 16)>${sys.getName()?lower_case}<#else>${sys.getDeploySysId()?lower_case}</#if><#else>${sys.getName()?lower_case}</#if>__web
- IBIZ_GATEWAY_DEFAULTSERVICEID=<#if sys.getDeploySysId()??><#if (sys.getDeploySysId()?length gt 16)>${sys.getName()?lower_case}<#else>${sys.getDeploySysId()?lower_case}</#if><#else>${sys.getName()?lower_case}</#if>
- IBIZ_GATEWAY_DEFAULTAPI=<#if app.getPSSysServiceAPI()??>${app.getPSSysServiceAPI().codeName?lower_case}<#else>api</#if>
<#comment>输出前端应用自定义参数替换标准参数</#comment>
<#if depApp.getUserParamNames()??>
<@outputUserParam depApp depApp.getUserParamNames()/>
</#if>
<#comment>输出微服务平台自定义参数替换标准参数</#comment>
<#if appPlatform.getUserParamNames()??>
<@outputUserParam appPlatform appPlatform.getUserParamNames()/>
</#if>
</#if>
deploy:
resources:
limits:
memory: 800M
reservations:
memory: 400M
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
networks:
agent_network:
driver: overlay
attachable: true
</#if>
<#comment>输出用户自定义参数</#comment>
<#macro outputUserParam paramObj paramList>
<#list paramList as param>
<#assign userParamkey=param?upper_case?replace(".","_")>
<#comment>nacos、数据库连接等信息从sysRun中获取</#comment>
<#if userParamkey!="SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR" && userParamkey!="SPRING_REDIS_HOST" &&
userParamkey!="SERVER_PORT" &&userParamkey!="SPRING_REDIS_PORT" &&userParamkey!="SPRING_REDIS_DATABASE"
&&userParamkey!="SPRING_DATASOURCE_USERNAME" &&userParamkey!="SPRING_DATASOURCE_PASSWORD"
&&userParamkey!="SPRING_DATASOURCE_URL" &&userParamkey!="SPRING_DATASOURCE_DRIVER-CLASS-NAME" &&userParamkey!="SPRING_DATASOURCE_DEFAULTSCHEMA">
<#comment>扩展标准配置:用户配置参数替换标准配置(application-sys.yml)</#comment>
<#if !P.exists('AppDeployUserParam',param)>
- ${userParamkey}=${paramObj.getUserParam(param,"")}
</#if>
</#if>
</#list>
</#macro>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册