ENV-var to specify config-file

Hi,

I have a number of smaller sites that I self-host and manage for customers, including theme development.

Locally when developing, I’d love the possibility to be able to have one config per site. This way I can have one Ghost instance, with per-site config and content, e.g;

CONFIG=dev-site01 NODE_ENV=dev ghost start

Boots up with /config.dev-site01.json, with the following:

  "database": {
    "client": "sqlite3",
    "connection": {
      "filename": "/home/workspace/ghost/content.dev-site01/data/ghost-local.db"
    }
  },
  [...]
  "paths": {
    "contentPath": "/home/workspace/ghost/content.dev-site01"
  }

Edit: It seems that there must be a content-folder at root, even tho contentPath is set to elsewhere:

✖ Starting Ghost: ghost-local-1
An error occurred.
Message: 'ENOENT: no such file or directory, lstat '/home/gnimmelf/workspace/ghost/content''

Debug Information:
    OS: Fedora, v31
    Node Version: v14.15.4
    Ghost Version: 3.41.5
    Ghost-CLI Version: 1.15.3
    Environment: development
    Command: 'ghost start'

Thanks,
Flemming

I’m not sure if this will work with Ghost CLI, but this is already possible w/ Ghost Core ~

NODE_ENV=dev-site01 node current/index.js should use config.dev-site01.json

Ok, see your point, but I still think my idea of ghost-cli accepting an env-var for the config to run is pretty good.

NOTE! Edited away my previous reply here as I didn’t see in your reply that you started it w/o ghost-cli.

Thanks!