score:0

Put your NODE_ENV at docker compose like this:

  server:
    image: your_image
    environment:
      - NODE_ENV=production

Then you can simplify your CMD to just CMD ["nodemon", "./server.js"]

score:0

Answering my own question here in case anyone sees a similar error: In my package.json, I had a dependency on node:

"dependencies": {
    ...
    "node": "^8.10.0",
    ...
  }

After removing this line, the docker container starts up correctly.


Related Query

More Query from same tag