V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
muskill
V2EX  ›  Docker

Spring Cloud 改造成 docker swarm 部署,无法读取到 classpath: 路径,怎么解决?

  •  
  •   muskill · Jul 1, 2020 · 1596 views
    This topic created in 2132 days ago, the information mentioned may be changed or developed.

    docker 小白,尝试使用 swarm 集群部署项目时遇到问题,项目利用 stack 运行后,一切正常,但是无法读取 classpath 路径,报 java.io.filenotfoundexception:file:/xxxx/ xxxx(No such file or directory) ,希望哪个大佬出来指点下,不胜感激 配置示例如下

    version: '3'
    services:
      api-demo:
        image: 192.168.1.6/cloud/api-demo:v1.0.0
        networks:
          - cloud-overlay
        ports:
          - "28081:28081"
        user: 1000:1000
        stop_grace_period: 1m30s
        deploy:
          replicas: 5
          update_config:
            parallelism: 2
            delay: 90s
            failure_action: pause
          restart_policy:
            condition: on-failure
            delay: 5s
            max_attempts: 3
            window: 120s
        environment:
          - ADDITIONAL_EUREKA_SERVER_LIST=eureka
          - INSTANCE.HOSTNAME=api-demo
          - SERVER_PORT=28081
    
    
    
    networks:
      cloud-overlay:
        external:
          name: cloud-overlay
    
    
    1 replies    2020-07-01 09:43:32 +08:00
    lululau
        1
    lululau  
       Jul 1, 2020 via iPhone
    file:/xxxx 这个是文件系统 uri 吧,不是 classpath uri 吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2345 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 15:39 · PVG 23:39 · LAX 08:39 · JFK 11:39
    ♥ Do have faith in what you're doing.