V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
muskill
V2EX  ›  Docker

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

  •  
  •   muskill · 2020-07-01 09:26:10 +08:00 · 1134 次点击
    这是一个创建于 1366 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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 条回复    2020-07-01 09:43:32 +08:00
    lululau
        1
    lululau  
       2020-07-01 09:43:32 +08:00 via iPhone
    file:/xxxx 这个是文件系统 uri 吧,不是 classpath uri 吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3196 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 00:37 · PVG 08:37 · LAX 17:37 · JFK 20:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.