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 .

But when ı want to run it on digital ocean server with ducker the images do not show. How can ı solve this?

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

Here my next config file :

The error,

Here is my docker file .

Submit an answer
Answer a question...

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.

Please i’m having this same issues, how were you able to solve it ??

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.



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.