Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Custom Config File Location #73

Closed
jtcressy opened this issue Aug 4, 2017 · 2 comments
Closed

Feature Request: Custom Config File Location #73

jtcressy opened this issue Aug 4, 2017 · 2 comments

Comments

@jtcressy
Copy link

jtcressy commented Aug 4, 2017

Hi,

We currently have no way of persisting the config.*.json files in /var/lib/ghost. The only volume we can mount is /var/lib/ghost/content. Upstream ghost has not implemented a custom config file location option, with either a command-line argument or environment variable.

What I propose is two (or three) different methods:

  1. ENV and Symbolic link

    • Establish an environment variable, GHOST_CONFIG that optionally contains a path to a config file, e.g. /config/config.production.json
    • Symlink the file in the entrypoint.sh with ln -fs $GHOST_CONFIG /var/lib/ghost/GHOST_CONFIG
  2. Volume and Symbolic link

    a.

    • Create new volume at /config
    • Symlink /config/config.*.json to /var/lib/ghost/config.*.json
      • ln -fs /config/config.*.json /var/lib/ghost/config.*.json

    b.

    • Just symlink /var/lib/ghost/content/config.*.json to /var/lib/ghost/config.*.json
      • ln -fs /var/lib/ghost/content/config.*.json /var/lib/ghost/config.*.json

My favorite method would be 2a. This enables users of both docker compose and kubernetes to manage their config files. Docker compose can just mount another volume, and kubernetes users can make use of ConfigMaps and mount them in their own dedicated directory.

I would gladly submit a pull request, but i'm unsure if I should make edits to each version of ghost (1.0-1.5) or just the latest (1.5). All we'd have to do is add some code to the entrypoint.sh and an ENV + VOLUME clause to the Dockerfile.

@SISheogorath
Copy link

What version of Ghost are you talking about?

  • 0.11 automatically links the config.js to the correct location.
  • 1.0+ allows you to configure ghost by environment variables

Where do you need more config?

@acburdine
Copy link
Collaborator

@jtcressy Going to close this because, as @SISheogorath noted, Ghost supports configuration via environment variables (see the above shared link).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants