@@ -1,11 +1,12 @@ | |||||
FROM java:8 | FROM java:8 | ||||
MAINTAINER king <1609724385@qq.com> | MAINTAINER king <1609724385@qq.com> | ||||
VOLUME /tmp | VOLUME /tmp | ||||
COPY sentinel-dashboard/target/sentinel-dashboard.jar sentinel_dashboard.jar | |||||
COPY sentinel-dashboard/target/sentinel-dashboard.jar app.jar | |||||
COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas | COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas | ||||
ENV TimeZone=Asia/Shanghai | ENV TimeZone=Asia/Shanghai | ||||
ENV active=dev | ENV active=dev | ||||
ENV JAVA_OPTS="-Xmx512M -Xms512M" | ENV JAVA_OPTS="-Xmx512M -Xms512M" | ||||
RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone | RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone | ||||
#EXPOSE 8098 | #EXPOSE 8098 | ||||
ENTRYPOINT java $JAVA_OPTS -Dserver.port=7777 -Dcsp.sentinel.dashboard.server=$IP:7777 -Dproject.name=sentinel-dashboard -Dsentinel.dashboard.auth.username=telpo -Dsentinel.dashboard.auth.password=telpo#1234 -jar /sentinel_dashboard.jar --spring.profiles.active=$active | |||||
ENTRYPOINT java $JAVA_OPTS -Dserver.port=7777 -Dcsp.sentinel.dashboard.server=$IP:7777 -Dproject | |||||
.name=sentinel-dashboard -Dsentinel.dashboard.auth.username=telpo -Dsentinel.dashboard.auth.password=telpo#1234 -jar /app.jar --spring.profiles.active=$active |
@@ -27,6 +27,8 @@ import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; | |||||
import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; | import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; | ||||
import com.alibaba.csp.sentinel.dashboard.domain.Result; | import com.alibaba.csp.sentinel.dashboard.domain.Result; | ||||
import com.alibaba.csp.sentinel.dashboard.domain.vo.MachineInfoVo; | import com.alibaba.csp.sentinel.dashboard.domain.vo.MachineInfoVo; | ||||
import org.slf4j.Logger; | |||||
import org.slf4j.LoggerFactory; | |||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||
import org.springframework.web.bind.annotation.PathVariable; | import org.springframework.web.bind.annotation.PathVariable; | ||||
@@ -41,9 +43,16 @@ import org.springframework.web.bind.annotation.RestController; | |||||
@RequestMapping(value = "/app") | @RequestMapping(value = "/app") | ||||
public class AppController { | public class AppController { | ||||
@Autowired | |||||
private static Logger logger = LoggerFactory.getLogger(AppController.class); | |||||
@Autowired | @Autowired | ||||
private AppManagement appManagement; | private AppManagement appManagement; | ||||
@GetMapping("/app.json") | |||||
public Result<List<String>> queryApp(HttpServletRequest request) { | |||||
return Result.ofSuccess(appManagement.getAppNames()); | |||||
} | |||||
@GetMapping("/names.json") | @GetMapping("/names.json") | ||||
public Result<List<String>> queryApps(HttpServletRequest request) { | public Result<List<String>> queryApps(HttpServletRequest request) { | ||||
return Result.ofSuccess(appManagement.getAppNames()); | return Result.ofSuccess(appManagement.getAppNames()); | ||||
@@ -7,7 +7,8 @@ spring.http.encoding.enabled=true | |||||
server.servlet.session.cookie.name=sentinel_dashboard_cookie | server.servlet.session.cookie.name=sentinel_dashboard_cookie | ||||
#logging settings | #logging settings | ||||
logging.level.org.springframework.web=INFO | |||||
logging.level.org.springframework.web=DEBUG | |||||
#logging.file=${user.home}/logs/csp/sentinel-dashboard.log | |||||
logging.file=${user.home}/logs/csp/sentinel-dashboard.log | logging.file=${user.home}/logs/csp/sentinel-dashboard.log | ||||
logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n | logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n | ||||
#logging.pattern.console= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n | #logging.pattern.console= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n | ||||
@@ -13,8 +13,8 @@ spring: | |||||
port: 8719 | port: 8719 | ||||
datasource: | datasource: | ||||
- nacos: | - nacos: | ||||
server-addr: 172.19.42.44:8848 | |||||
data-id: ${spring.application.name}-sentinel-flow | |||||
group-id: DEFAULT_GROUP | |||||
data-type: json | |||||
rule-type: flow | |||||
server-addr: 172.19.42.44:8848 | |||||
data-id: ${spring.application.name}-sentinel-flow | |||||
group-id: DEFAULT_GROUP | |||||
data-type: json | |||||
rule-type: flow |
@@ -12,8 +12,8 @@ spring: | |||||
dashboard: 172.19.192.44:7777 | dashboard: 172.19.192.44:7777 | ||||
datasource: | datasource: | ||||
- nacos: | - nacos: | ||||
server-addr: 172.19.42.44:8848 | |||||
data-id: ${spring.application.name}-sentinel-flow | |||||
group-id: DEFAULT_GROUP | |||||
data-type: json | |||||
rule-type: flow | |||||
server-addr: 172.19.42.44:8848 | |||||
data-id: ${spring.application.name}-sentinel-flow | |||||
group-id: DEFAULT_GROUP | |||||
data-type: json | |||||
rule-type: flow |