【问题标题】:Docker-compose - npm ERR! Failed at the client@0.1.0 start scriptDocker-compose - npm 错误!在 client@0.1.0 启动脚本失败
【发布时间】:2020-07-31 12:55:19
【问题描述】:

我有一个使用 docker-compose 构建的应用程序,它运行良好,直到我做了一个新的:

docker-compose -f docker-compose-dev.yml up -d --build

即使我没有接触我的“客户端”服务配置,它现在也中断了以下日志:

The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the client@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-04-17T21_19_15_181Z-debug.log

> client@0.1.0 start /usr/src/app
> react-scripts start

现在服务nginx 无法将上游连接到“客户端”。

...

client:
    build:
      context: ./services/client
      dockerfile: Dockerfile-dev
    volumes:
      - './services/client:/usr/src/app'
      - '/usr/src/app/node_modules'
    ports:
      - 3000:3000
    env_file:
      - .env-dev
    depends_on:
      - web

有解决办法吗?

【问题讨论】:

    标签: docker nginx npm docker-compose


    【解决方案1】:

    Docker 网络非常敏感。

    重建后为我解决了什么问题:

    $ docker rmi $(docker images --filter "dangling=true" -q --no-trunc) --force
    

    然后:

    $ docker-compose -f docker-compose-dev.yml down
    

    最后:

    $docker-compose -f docker-compose-dev.yml up -d
    

    【讨论】:

      猜你喜欢
      • 2021-01-02
      • 1970-01-01
      • 2020-08-08
      • 2019-02-10
      • 2014-12-19
      • 1970-01-01
      • 1970-01-01
      • 2021-04-26
      • 2017-06-07
      相关资源
      最近更新 更多