apache in container does not start with NFS directory

have a problem that and need your help with.

Following the scenario:

I have WEB applications in docker, which have a proxy (reverse) in apache, it directs to the other containers that are in the WEB application (also in apache) These applications are all on port 443, that is, they all have certificates.

The certificates are in a filesystem and I mount the directory through NFS.

These machines are from an approval environment, so they are only connected during business hours.

Here we have the problem.

The apache (proxy) does not go up and with that the application does not stay in the air. I found that it does not go up because apache only goes up when it finds the directory with the certificates. Because when the docker is going up it still hasn’t finished mounting the NFS directory

In short:

I need to know if there is any way for docker to go up after the mounted directory?

I do not know if i was clear. But thanks in advance for help.

If I use the docker-compose down and up command, after starting the machine, apache manages to stay UP.

If I remove the nfs share, and put the certificate in a local directory, it starts normally.

But it’s not my ideal scenario.

Sounds like the issue that you’re facing is related to the order in which services are starting up. The Apache container is failing to start because it depends on the NFS mount being available, but the NFS mount is not yet available when the container starts.

You can control the order of service startup and shutdown with the depends_on option Control startup and shutdown order in Compose

That’s Cool!

However, I don’t think it’s a solution for my case.

mount is outside the container, on the docker host. It is mounted via /etc/fstab: server:/certificates/certs/ /apps/sgugpl/certificates nfs defaults 0 0 ## CERTIFICATES ##

And in docker-compose.yml ${VOLUMES_PATH}/certificates:/etc/httpd/conf.d/certificates –