errors with docker next.js
I keep having this error when building the docker image on refine with next.js
>>> COPY --from=builder /app/refine/public ./public
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref : "/app/refine/public": not found
I changed the base dockerfile from refinedev/node:18
to node:18-alpine
with some other changes3 Replies
Hi @SetiZ. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided, it seems like the error is occurring because the Docker build process is unable to find the
/app/refine/public
directory in the builder stage of your Dockerfile. This could be due to a number of reasons such as the directory not existing, or not being correctly copied into the Docker image during the build process.
If you've made changes to the base Dockerfile, it's important to ensure that these changes are not causing the issue. For instance, changing the base image from refinedev/node:18
to node:18-alpine
could potentially cause issues if the refinedev/node:18
image has specific configurations or dependencies that are not present in the node:18-alpine
image.
Refine does not have a specific deployment configuration on its own. It's a meta-framework and applications are usually built on top of other frameworks like Next.js. Therefore, you can follow the Next.js deployment guide (https://nextjs.org/docs/deployment) for deploying your application.
For convenience, Refine has created a refinedev/Dockerfiles (https://github.com/refinedev/dockerfiles) GitHub repository that contains Dockerfiles for each of the frameworks including Next.js. These Dockerfiles are derived from their respective official Dockerfile examples, using refinedev/node (https://hub.docker.com/r/refinedev/node) as base image, which has a non-root
refine:nodejs
user. You might want to refer to these Dockerfiles for guidance.
If the issue persists, it would be helpful to share the complete Dockerfile and any other relevant information for further assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@267689263246606336> kapa.ai is still learning and improving, please let us know how it did by reacting below
environmental-rose•5mo ago
it's very weird.. Even when I copy the dockerfile from nextjs, I still have the error. The only way to fix it was to remove that line :x
well that's logic. there's no public folder..