-
Hello Timlrx, Thanks for making this blog available. It is a great source for study. Would you have any advice for how to dockerize it? I started with the Dockerfile template from nextjs: https://nextjs.org/docs/deployment It builds an image of your app but it does not run. When trying to docker run the image I get the error:
I think this has something to do with your webpack publicPath. (I wonder why you use this instead of basePath.) I tried changing publicPath in your config file and the copy source directory in the Dockerfile but could not get it working. If you have any advice on how to dockerize the app I would appreciate it. Thanks again. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Can you post your Dockerfile? |
Beta Was this translation helpful? Give feedback.
-
Here's my working Dockerfile
|
Beta Was this translation helpful? Give feedback.
-
Got it! I ran into a permissions problem on run. So I added the --chown to the COPY to ./public. I also added: RUN npm config set unsafe-perm true Which might be asking for trouble. I also have trouble with docker networking on localhost (I'm on Ubuntu). So I have to docker run with --network=host Thanks again for your attention. (sorry about the markdown formatting on the dockerfile) |
Beta Was this translation helpful? Give feedback.
Here's my working Dockerfile