Spawning applications based on a directory of config files #260

Closed
mattrobenolt opened this Issue Mar 9, 2012 · 8 comments

Comments

Projects
None yet
5 participants

Proposing this would allow a more traditional deployment method with a "sites-available".

I envision a command such as forever vhosts /etc/forever/sites-available and the directory would contain a set of *.json config files.

Each config would be structured similar to:

{
  "script": "/var/www/app.js",
  "accessLog": "/var/log/my-app/access.log",
  "errorLog": "/var/log/my-app/access.log",
  "options": {
    "max": 3
  }
}

All of these options would be passed along right to a start command, simulating a bunch of forever start ... commands.

Also: I'm willing to develop the feature myself, I just want to make sure it's done in a way that is in line with the rest of the project.

Owner

indexzero commented Mar 9, 2012

Lets start small. I would first envision this as a .forever file (with the format you've described) in the current directory one could simply:

  $ forever start
  Using settings in /path/to/pwd/.forever
  {
    "script": "/var/www/app.js",
    "accessLog": "/var/log/my-app/access.log",
    "errorLog": "/var/log/my-app/access.log",
    "options": {
      "max": 3
    }
  }

From there we can talk about directories of these files. Start small, incremental improvement

No problem. I'll fork the repo and take a stab at this today.

@mattrobenolt mattrobenolt added a commit to mattrobenolt/forever that referenced this issue Mar 9, 2012

@mattrobenolt mattrobenolt Load config from .forever file, refs foreverjs/forever#260 e7e0eec

@indexzero Very simple, just pass along EVERYTHING through options just like it's specified in the actual API. The only required field is "script" inside the .forever file. This could very easily work to spin up a directory of files without an issue.

Bump.

tglines commented Apr 4, 2012

+1

alexbhr commented Apr 24, 2012

+1

Guuz commented Jun 19, 2012

This sounds like a good idea. Right now i have a start.sh script with the (long) forever start command with all the needed parameters for logfiles etc. It would be better if you could start your applicatie through forever in combination with a options file.

I also set the PORT and NODE_ENV enviroment variables.

This was referenced Apr 21, 2013

indexzero removed the low-priority label Oct 30, 2014

Owner

indexzero commented Jul 24, 2015

Fixed in #733 and #737

indexzero closed this Jul 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment