Giter Club home page Giter Club logo

Comments (14)

alterationx10 avatar alterationx10 commented on August 20, 2024 3

Just chiming in here, as I was having trouble setting up the mail variable, but figured out a bit more. As usual, the answer had been staring me in the face for the past hour!

The key line from the documentation is:

For nested config options, you'd need to separate them with two underscores:

A configuration that looks like:

"mail": { 
  "transport": "SMTP",
  "options": { 
      "service": "Mailgun",
      "auth": { 
          "user": "[email protected]",
          "pass": "doremiabc123"
      }
  }
} 

Should have 4 independent variables set. My corresponding kubernetes deployment config would look like:

        - name: mail__transport
          value: SMTP
        - name: mail__options__service
          value: Mailgun
        - name: mail__options__auth__user
          value: [email protected]
        - name: mail__options__auth__pass
          value: doremiabc123

from ghost.

acburdine avatar acburdine commented on August 20, 2024 2

It's a bit odd, but it needs to be a lowercased environment variable, e.g. url rather than URL

from ghost.

mwakerman avatar mwakerman commented on August 20, 2024 1

Yep, I just lost a few hours to the contentPath issue which was pretty frustrating.

from ghost.

nicokaiser avatar nicokaiser commented on August 20, 2024 1

This is still true for the 1.x version of the container: there is no (elegant) way to mount the "config.production.json" file – which is needed to e.g. set the base URL.

from ghost.

pascalandy avatar pascalandy commented on August 20, 2024

Here is the notes I added on in my Dockerfile. Once you get the pattern, you're good to go!

## Good to know: ENV GHOST_SOURCE /usr/src/ghost
## Good to know: ENV GHOST_CONTENT /var/lib/ghost
## Good to know: WORKDIR $GHOST_SOURCE
## root@ec780f67ae5a:/var/lib/ghost# 
##
## The Directory structure is NOT the same as the original ghost ...
## ... there is no content directory
## apps  config.js  data  images  storage   themes
## theme are here > /var/lib/ghost/themes
##                                      not in /var/lib/ghost/content/themes

from ghost.

acburdine avatar acburdine commented on August 20, 2024

@nicokaiser not true πŸ˜‰ with ghost 1.0 comes the ability to configure your instance via environment variables - this is the intended way of doing things with ghost 1.x in Docker. See the docs for more information.

from ghost.

nicokaiser avatar nicokaiser commented on August 20, 2024

@acburdine That sounds great, did not know about this!

However, it does not work. I set the "URL" environment, yet it is ignored (same if I manually run "URL=... node current/index.js" in the container). Am I missing something?

from ghost.

nicokaiser avatar nicokaiser commented on August 20, 2024

Awesome, that works! Thank you @acburdine!

from ghost.

cowchimp avatar cowchimp commented on August 20, 2024

Please consider mentioning this (the option to set configuration options via the environment variables) in the Readme for the image. Many people are likely to bump into this. Thanks.

from ghost.

justinoverton avatar justinoverton commented on August 20, 2024

The docs don't specify how to configure mail settings via env.

from ghost.

rgarrigue avatar rgarrigue commented on August 20, 2024

πŸ‘ for the official ghost doc a bit lacking about mail (like gmail or custom mail). And docker's README.md missing a hints for this kind of configuration.

@justinoverton I'm was able to turn privacy on via privacy='"privacy": {"useTinfoil": true}'. I guess you can put a flat json following https://docs.ghost.org/docs/mail-config for mail config

from ghost.

dexafree avatar dexafree commented on August 20, 2024

It's a bit odd, but it needs to be a lowercased environment variable, e.g. url rather than URL

@acburdine I used the official ghost:1.7.0-alpine image, and I tried to start a container with

docker run --rm -it \
 -p 2368:2368 \
 -e url="https://MY_URL" \
 -v /mnt/docker/ghost:/var/lib/ghost/content \
 ghost:1.7.0-alpine

If I curl https://MY_URL, it responds with a redirect to localhost:2368.

Is the env variable working only if you built the image from this dockerfile? (It would be nonsense, as I assume that the official image is the result of building this dockerfile).

It would also be nonsense having to build a dockerfile just to change this settings.

Is there something I'm missing?

Do you need to set the entrypoint/cmd manually when starting the container?

from ghost.

rgarrigue avatar rgarrigue commented on August 20, 2024

@dexafree : url env worked with ghost:latest for me

from ghost.

Vadorequest avatar Vadorequest commented on August 20, 2024

@dexafree Indeed, your issue is that you provided the url between double quotes. There shouldn't be any.

I'm running
docker run -e url=http://eclats-de-voix.fr/ -d --name blog.eclats-de-voix-2 -p 3003:2368 -v /var/www/blog.eclats-de-voix:/var/lib/ghost/content ghost:1.12.1-alpine
and it works fine. I tried first with your example (with double quotes) and it failed. ;)

from ghost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.