【发布时间】:2021-01-03 12:45:16
【问题描述】:
我创建了一个 express API,它会在端口 5000 上正常运行。当我把它放在 Docker 容器上时,它一开始会运行,但后来我收到这样的错误消息。
> nodejs-express-sequelize-postgresql@1.0.0 start
> nodemon server.js
[nodemon] 2.0.6
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node server.js`
(node:33) [SEQUELIZE0004] DeprecationWarning: A boolean value was passed to options.operatorsAliases. This is a no-op with v5 and should be removed.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:33) Warning: Accessing non-existent property 'Sequelize' of module exports inside circular dependency
Server is running on port 5000.
Executing (default): CREATE TABLE IF NOT EXISTS "simplenims" ("id" SERIAL , "nim" VARCHAR(255), "nama" VARCHAR(255), "status" BOOLEAN, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id"));
[nodemon] Internal watch failed: Circular symlink detected: "/usr/bin/X11" points to "/usr/bin"
npm ERR! code 1
npm ERR! path /
npm ERR! command failed
npm ERR! command sh -c nodemon server.js
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-12-14T11_53_26_130Z-debug.log
这是我的 Dockerfile 的样子
FROM node:latest
WORKDIR /
COPY package*.json ./
RUN npm install
COPY . .
ENV port=5000
EXPOSE 5000
CMD ["npm", "start"]
我按照 Docker 的文档制作了 Dockerfile。有什么问题或者我需要添加 Doccerfile 吗?
【问题讨论】: