我正在尝试将以下项目部署到生产中:https://github.com/saleor/apps 有问题的子模块: https: //github.com/saleor/apps/tree/main/apps/slack
这是我正在采取的步骤。
我已经output: "standalone"在 next.config.js 中设置了
问题是当我尝试使用以下命令运行独立服务器时:
node .next/standalone/apps/slack/server.js
Run Code Online (Sandbox Code Playgroud)
直到我这样做:
localhost:3000然后 404 就消失了...即使在运行时node .next/standalone/apps/slack/server.js

我问是因为这似乎与 Next.js 有关,而不是与应用程序本身有关?但我没有 Next.js 或 Node 开发经验,所以我不确定。
这对我来说是一个问题,因为我想制作一个 docker 镜像。我在将此工作流程转换为 Dockerfile 时遇到问题。
编辑:
我尝试使用https://github.com/vercel/next.js/tree/canary/examples/with-docker中的 Dockerfile
但是它们不包含start在构建过程中。
编辑2:
通过运行diff -qr working/ broken/我发现运行后没有任何差异pnpm start。这可能是 Chrome 缓存造成的吗?
编辑3:
这似乎是一个缓存问题,因为在运行 pnpm start 并从 chrome 访问页面后,使用独立 server.js 时,问题在 Firefox 中仍然存在,但是我不知道为什么在使用时加载页面,而 …