Question

NexJS next-image not working on my server

Hello I have a website which is developed Nextjs. I use Next Image for the images. When ı build my project and locally run it (yarn start) everything is fine .

https://i.stack.imgur.com/DMB7z.png

But when ı want to run it on digital ocean server with ducker the images do not show. How can ı solve this?https://i.stack.imgur.com/SAZCH.png

When ı run the docker file in my project the NextImage run without any errors.

https://i.stack.imgur.com/DMB7z.png

Here my next config file : https://i.stack.imgur.com/QwZZ2.png

The error, https://i.stack.imgur.com/JdgSg.png

Here is my docker file . https://gist.github.com/kubilaybzk/851946f91b8bffb7bb989be90c9b0669


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there,

I’ve just checked your website and you seem to have fixed it already! Would you mind sharing the details on how you solved the problem here with the community?

I believe that a possible issue could be that you need to write src={/photoname.format} when it’s Next Image, instead of the whole path.

Best,

Bobby