-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker run cannot find package json #38
Comments
I think I solved it. My docker file is wrong. need to use WORKDIR /repo then COPY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I was able to run yarn web:start from CMD. However when I try to run this in Docker. I got package.json not found error.
Here is the docker file:
FROM node:16.13.0-alpine
set working directory
WORKDIR /
COPY ["yarn.lock", "package.json", "./"]
RUN yarn reset:unix
RUN yarn
add app
COPY . ./
start app
CMD ["yarn", "web:start"]
After successful docker build, I try to run in docker desktop:
docker run -p:3000:3000 myimage
I got this error:
yarn run v1.22.15
$ yarn workspace @my-app/web start
$ craco start
/node_modules/find-root/index.js:19
throw new Error('package.json not found in path')
^
Error: package.json not found in path
at findRoot (/node_modules/find-root/index.js:19:11)
at findRoot (/node_modules/find-root/index.js:28:10)
at findRoot (/node_modules/find-root/index.js:28:10)
at findRoot (/node_modules/find-root/index.js:28:10)
at findRoot (/node_modules/find-root/index.js:28:10)
Any idea on this?
Thanks for the help
The text was updated successfully, but these errors were encountered: