#✅ Link images broken after docker restart

45 messages · Page 1 of 1 (latest)

empty wraith
#

Hello, when i restart directus on docker with plesk, images links are broken. Could you guide me to find a solution ? Thank you

sour flaxBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:

  • Adding an explanation of exactly what you're trying to achieve.
  • Adding any and all related code or previous attempts.
  • Describing the exact issue or error you are facing.
  • Posting any screenshots if applicable.
  • Reading through https://stackoverflow.com/help/how-to-ask.

When you're done with this thread, please close it. Thanks! ✨

(If you have a support agreement and need help, please contact the core team via email.)

meager robin
#

If you have added the volume on the current instance and restart => files uploaded before that already gone => no image appear

All the files you upload AFTER will work. If not, check the CHMOD of the folder you have created and mapped

vital fox
#

Would be very helpful to share either the docker run command or the compose file. But as @meager robin mentioned, it sounds the the volume (which persists any "custom" data) was not set up correctly.

empty wraith
#

Hello, here is my configuration.. i don't have explicitly set a volume mapping "see on top of image"... It's important to notice that the deployment is done of front of plesk, i didn't use command line...

#

on top of this image i can set up a volume mapping. I've tried to add this but didn't seems to work (i could come from my settings)

#

Do you have an example of volume mapping for directus ? What i tried didn't worked 😦

#

@vital fox @meager robin

meager robin
#

On your image, I do not think that's the volume mapping there.
Lemme help you

Please DM me your Teamviewer/Anydesk, I will help you to config.

vital fox
#

still an issue? Would be helpful to share the solution to help others as well 🙂

meager robin
#

Yeah, still having issue, need to help her first, then update here.

#

You see the image? there's no volume mapping, screenshot was env values

vital fox
#

yes, I'm not sure if cut of OR if there is any mapped volume above the screenshot 😄

#

pretty sure the volume was missing – ran into this issue several times when I had started using Docker

empty wraith
#

what is certain : my configuration doesnt explecitly map a volume

#

as said on top of the image : mappage de volume is volume mapping is not set up. Do you have a common setting for that ?

vital fox
#

do you setup the container in this tool (what is it?) or by just running a command?

empty wraith
#

@meager robin i cant contact you in private

#

@vital fox only with this tool

vital fox
#

you have to map some folder from the Host into the container:

e.g. (path/on/host:path/in/container)
./uploads:/directus/uploads

So you have to create a mapping there, some folder on the host to this within the container

#

so my local host has after the start a new directory called "uploads" which contain everything thats inside the container at "directus/uploads", after restarting the container, all the data is still on the host system and therefore within your container as well

empty wraith
#

ok ! itry you setting !

#

this way :

vital fox
#

depending on the GUI your are using this might work, but I don't know which gui this is, and how it is managing the volumes

empty wraith
#

do you have an idea the path to use : left is container, right is host (i definitely dont understand waht it correspond to)

vital fox
#

could also be needed to create the volume manually within the gui and refer an ID to the mapping, as it is done by my GUI:

empty wraith
#

oh i see

vital fox
#

it "sync" all the data (files) between the host system and the container

empty wraith
#

i'll try to find the id of the volume

vital fox
#

so the files actually exist only once, but are reachable (like an USB stick) within the container

#

it really depends on the GUI - as mentioned there is no need for an ID but there could be an ID

#

I would also recommend to store the data not on /uploads within the host, as this is the the first level of the root system.. something like "/myuser/my-app/data/uploads/" would be better. But it might be helpful to read though the docker basics before for a better understanding how it is working. Basically it's not related to Directus it self, it just a Docker thing 😄

empty wraith
#

i really need to improve my docker skills 🙂

#

oh i think it works !!!!

vital fox
#

e.g. if using the managed volumes from the GUI, the ID it self will be replaced with the actual path:

empty wraith
#

i do some test and share the solution 😉

vital fox
#

but keep in mind the data is dropped if you delete the folder, but feel free to move it around and place it "wherever" you want

empty wraith
#

i'm so angry, it doesnt work 😦 every time docker restart, the image links are broken ....

vital fox
#

as @meager robin mentioned, it's kind of hard to assist in those cases w/o access, especially if you're new to Docker

#

what is this application gui called, you're using?

meager robin
#

Problem solved, usually we do mapping is: host-path:container-path
but on Plesk, it's opposite, should input container-path:host-path

#

guided her to create a folder, set permission then input the right place, worked

sour flaxBOT
#

✅ Link images broken after docker restart