gpt4 book ai didi

node.js - 标准_init_linux.go :219: exec user process caused: no such file or directory - docker problem

转载 作者:行者123 更新时间:2023-12-03 23:19:56 25 4
gpt4 key购买 nike

我在运行命令时遇到了 docker 问题 docker-compose up -d --build 3个容器 app, database, api在应用程序中创建 innovation ,但是当访问 api 容器中的 docker 终端时,我收到此错误``这是我的 docker-compose.yaml:

version: "3"

services:
api:
build: ./api
entrypoint: ./.docker/entrypoint.sh
container_name: quimiweb-innovation-api
env_file: .env
environment:
DATABASE_CLIENT: ${DATABASE_CLIENT}
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_HOST: ${DATABASE_HOST}
DATABASE_PORT: ${DATABASE_PORT}
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
FRONTEND_URL: ${FRONTEND_URL}
ports:
- "1337:1337"
volumes:
- ./api/:/home/node/api
networks:
- app-network

database:
image: mongo
container_name: quimiweb-innovation-database
env_file: .env
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
networks:
- app-network
volumes:
- .database/:/data/db
ports:
- "27017:27017"

app:
build: ./app/
entrypoint: ./.docker/entrypoint.sh
container_name: quimiweb-innovation-app
env_file: .env
environment:
SKIP_PREFLIGHT_CHECK: ${SKIP_PREFLIGHT_CHECK}
ports:
- 3001:3001
volumes:
- ./app/:/home/node/app

networks:
app-network:
driver: bridge

volumes:
app-volume:

我来自 api 的 entrypoint.sh:
#!/bin/bash

yarn
yarn develop

最佳答案

就我而言,我通过更改 CRLF 的行结尾来解决它至 LFentrypoint.sh文件
编辑
在右侧底部面板的 Notepad++ 中,右键单击区域 Windows (CR LF)并选择 UNIX (LF)这应该替换所有 CRLFsLFs .

关于node.js - 标准_init_linux.go :219: exec user process caused: no such file or directory - docker problem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66173549/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com