Post Start Hook not working, no errors, container starts fine

[EDIT]: Included a screenshot of my docker-compose file. The hook on line 12 works, the one on line 24 doesn’t. data/migration is a subpath of /var/www/html/evrdrv-storage inside the container. If I put the full_path it doesn’t work either.

Greetings.

I have a two containers defined in a docker-compose.yaml. Both have a post_start hook that are bash commands. Container #2’s hook depends on the execution of Container #1’s hook, so I have a -depends_on correctly declared.

Container #1’s hook runs perfectly fine. Container #2’s doesn’t. No errors, no information about it on docker logs, nothing. If I enter Container #2’s bash and copy paste the command it works flawlessly.

Restarting the container does nothing, everything builds, everything starts, but there’s no way that hook executes…

What can I be missing here??

TIA,

Note that a depends_on only works during compose startup, not after a server reboot. So it’s better for the app to be able to wait for the database itself.

1 Like