Comments (14)
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.
It's a bit odd, but it needs to be a lowercased environment variable, e.g. url
rather than URL
from ghost.
Yep, I just lost a few hours to the contentPath
issue which was pretty frustrating.
from ghost.
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.
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.
@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.
@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.
Awesome, that works! Thank you @acburdine!
from ghost.
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.
The docs don't specify how to configure mail settings via env.
from ghost.
π 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.
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.
@dexafree : url env worked with ghost:latest for me
from ghost.
@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)
- Custom Port HOT 1
- DatabaseError: Access denied for user HOT 3
- 5.43.0 Released without AMD tags HOT 1
- Request for updated Docker Image. HOT 1
- ghost new version doesnt work HOT 1
- SQLITE_ERROR: no such column: author_id HOT 1
- ETA On ghost:5.54.2 docker container image in dockerhub? HOT 2
- Sign in and subscription buttons do not function HOT 6
- connection refused
- ghost:5.65-alpine: no matching manifest for linux/arm/v7 in the manifest list entries HOT 2
- find: /var/lib/ghost/content/themes/source: No such file or directory HOT 7
- Tag 5.75.1 cannot be pulled HOT 2
- Alpine images failing to build for arm32vN and arm64v8 HOT 13
- Updating from 5.0.1 -> 5-alpine seems to wipe the entire database? HOT 1
- Unable to post the blog on my website through a self hosted ghost page
- Missing ARM Tags for Docker Image 5.76.2 HOT 2
- "Cannot get /"
- Upgrade error
- mysql version 8.4 - ''mysql_native_password' is deprecated and will be removed in a future release HOT 1
- Ghost docker image build HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghost.