質問

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

役に立ちましたか?

解決

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

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

他のヒント

You can chain a set of shell commands together. With the current version of Foreman, you do not need to wrap this in a shell command as in @JohnDoe's answer.

web: cd server_dir && start web_service
clk: cd clock_tower && start timers

These would start the necessary processes from their respective folders and track them independently.

An answer to "How can I specify in the Procfile where the process is to be started?"

You can tell Foreman where the application root directory meaning that this does not have to be the same place as the Procfile.

You can start Foreman with the -d option (may need to use -f to the Procfile too).

  $ foreman start -d ./directory

http://ddollar.github.io/foreman/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top