Search code examples
foremanprocfile

Procfile start processes in their own working directory


I have this simple Procfile

web: myapp

myapp is in the path, but the processes home directory should be ./directory/. How can I specify in the Procfile where the process is to be started?

https://github.com/ddollar/foreman/pull/101 doesn't help because it assumes, that this working directory should be the same for every process specified by the Procfile


Solution

  • The shell is the answer. It's as simple as

    web: sh -c 'cd ./directory/ && exec appname'