post deploy command

What would be the best way to run a command AFTER the deployment is finished?

My mounted volume has configs for an application that can’t be part of the build process so the app needs ran after the volume is mounted, which doesn’t seem to happen until after the container is started.

Any ideas?

I may not be understanding, but I’m guessing what you mean is after the build completes, and before the web server is started? If so, and if what you are describing is quick, then the best way is generally to create a small script that runs that process and then starts your web server; and to replace the CMD in your dockerfile with the name of this script.

If this process is lengthy, then it may be worth adding another webserver like nginx set up to start quickly and serve a “please wait” response until your real server starts, and then reverse proxy future requests to your web server once it starts. If you are interested, I can provide more details (I do this myself).

I got it to work, the entrypoint did help me figure it out, ultimately the issue was that after the volume was mounted to the home dir I needed to source the .profile

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.