How to delay container startup #1426
-
When my VM running docker and in that PhotoPrism reboots I find that Photoprism cannot see my network drive and therefore thinks all the photos are missing. If I restart the PhotoPrism container all is fine however so I'm guessing that the container is starting before the network is ready. What is the best way to make sure the network drive is ready before the container loads? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
It depends on what init service manager is running inside your VM.
Depending on the service manager, you'll need to appropriately add the
dependency.
For example, on systemd based systems, you'll have to put your docker
service to depend on your network share service.
s3nt fr0m a $martph0ne, excuse typ0s
…On Sat, 10 Jul, 2021, 13:42 wormvortex, ***@***.***> wrote:
When my VM running docker and in that PhotoPrism reboots I find that
Photoprism cannot see my network drive and therefore thinks all the photos
are missing. If I restart the PhotoPrism container all is fine however so
I'm guessing that the container is starting before the network is ready.
What is the best way to make sure the network drive is ready before the
container loads?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1426>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAP7SCNRZDLC2H4M7YBWTDTW76FVANCNFSM5AD75UGQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Yes. Something like
https://unix.stackexchange.com/questions/246935/set-systemd-service-to-execute-after-fstab-mount
s3nt fr0m a $martph0ne, excuse typ0s
…On Sat, 10 Jul, 2021, 14:55 wormvortex, ***@***.***> wrote:
So you're saying rather than delay the container I want to be looking at
delaying the entire docker process from starting too early?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1426 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAP7SDTLMHZ3ZB4LXN5FDLTXAGXZANCNFSM5AD75UGQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Your files must be visible when PhotoPrism is running. Seems best to put a script in place that knows when your files were mounted properly, and delays startup for so long.
|
Beta Was this translation helpful? Give feedback.
-
Tried to delay the docker process starting but that doesn't seem to have helped. Still finding the VM boots, docker boots and then the photoprism container boots but must be happening before the VM shared folder is ready as it can't see any folders until I restart the container. |
Beta Was this translation helpful? Give feedback.
Your files must be visible when PhotoPrism is running. Seems best to put a script in place that knows when your files were mounted properly, and delays startup for so long.
docker-compose up -d
after your files were mounted./entrypoint.sh
, ideally based on the existing one: https://github.com/photoprism/photoprism/blob/develop/docker/scripts/entrypoint.sh