My media files are not found after docker compose down then up #7251
Replies: 2 comments
-
any updates? |
Beta Was this translation helpful? Give feedback.
-
My issue turned out to be different, but it's semi-related: Using Payload versions:
I experienced a similar bug after restarting my mongodb and payload containers from yesterday. My images are stored in /media in a docker container and don't show up initially. However - after I log into the admin panel , the errors go away and the images show up. I found restarting the containers fast doesn't cause the issue, but if I wait about 2 minutes between shutting them down and starting them up, I can get it to come back. An error comes from the payload project (when it tries to display an image from /media):
Digging the compiled code it was coming from
Which reminded me of this code from the website template repo:
Which I had set to all of my collections like
Even though only some of my collections were using drafts, therefore the published column would be missing. Unfortunately in your case you already have |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have vps that i spin my payload app and nextjs frontend app. My media are persistent when i upload delete any media files. But when in my hetzner machine i stop the docker containers and run them my images are lost
i was thinking if the problem is volumes. I already added the volumes correctly i think like here. As you see i added volume in to persist images.
volumes:
- payload-data:/home/node/app/dist/media
Then i though maybe the problem is in my Media.ts setup. But did not see anything suspicious
i have already link for my repo
https://github.com/sayinmehmet47/blueastowel-cms
Beta Was this translation helpful? Give feedback.
All reactions