Cannot find module /app/vercel when trying to dockerize this project
PFbHzsiF opened this issue · comments
I want to run this great project in a docker container.
The following is my dockerfile
FROM node:20.2
COPY viz-gpt /app
WORKDIR /app
ENV PATH /root/.yarn/bin:$PATH
RUN curl -o- -L https://yarnpkg.com/install.sh | bash && \
yarn install
# Start the service
CMD ["vercel", "dev"]
And I got the following error when I start this docker image.
2023-05-26 15:53:03 node:internal/modules/cjs/loader:1073
2023-05-26 15:53:03 throw err;
2023-05-26 15:53:03 ^
2023-05-26 15:53:03
2023-05-26 15:53:03 Error: Cannot find module '/app/vercel'
2023-05-26 15:53:03 at Module._resolveFilename (node:internal/modules/cjs/loader:1070:15)
2023-05-26 15:53:03 at Module._load (node:internal/modules/cjs/loader:923:27)
2023-05-26 15:53:03 at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
2023-05-26 15:53:03 at node:internal/main/run_main_module:23:47 {
2023-05-26 15:53:03 code: 'MODULE_NOT_FOUND',
2023-05-26 15:53:03 requireStack: []
2023-05-26 15:53:03 }
2023-05-26 15:53:03
2023-05-26 15:53:03 Node.js v20.2.0
My first try is using npm run dev
instead of vercel dev
. But I got Unexpected end of JSON input
like this link
So I head back to vercel dev
.
ChatGPT let me add yarn add vercel
after yarn install
. But it doesn't work.