我有一个反应应用程序,它简单地显示 hello-world 消息,但我喜欢通过 docker-container 运行该应用程序,但遇到了这个问题。收到此消息后,进程停止运行而不运行应用程序..
ℹ 「wds」: Project is running at http://172.17.0.2/
ℹ 「wds」: webpack output is served from
ℹ 「wds」: Content not from webpack is served from /app/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...
不明白我应该做什么,因为我有一个非常小的应用程序,在 Dockerfile 中包含基本代码
FROM node:alpine
RUN mkdir /app
COPY . /app
WORKDIR /app
COPY package.json ./
RUN npm install
CMD ["npm", "start"]
我是否需要安装 webpack-dev-server,我尝试过,但收到版本错误,例如“手动添加的服务器”的版本低于已有服务器的版本。所以我重新安装了 webpack-dev-server。
我已经使用“create-react-app”创建了应用程序,所以我认为每个依赖项都是自动管理的。
有人知道吗,我该如何解决这个问题..提前致谢(顺便说一句..)
我用来构建的命令:docker build . -t lucki
运行镜像的命令:docker run -p 3000:3000 lucki
this is project stracture: ![enter image description here](https://i.stack.imgur.com/rPtka.png)
after adding DEBUG=* in Dockerfile, I have response as:
![enter image description here](https://i.stack.imgur.com/LWR24.png)