-
Notifications
You must be signed in to change notification settings - Fork 317
Unable to run in production #15
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
Comments
I've found out what the issue was: The Ghost
Actually what's happening is that the configuration directive is completely missing. This makes the issue pretty frustrating considering that we are using this software under Docker and most probably using the content path mounted to preserve data. Not sure whether this is a Ghost issue or an issue with the Docker image where the configuration takes place, let's discuss so that we could deliver a solid and reliable solution to the problem. /CC @javorszky |
Not sure if it is an oversight or on purpose, but the example config does not have any "paths" in the production section. The only thing we do is sed -r '
s/127\.0\.0\.1/0.0.0.0/g;
s!path.join\(__dirname, (.)/content!path.join(process.env.GHOST_CONTENT, \1!g;
' |
@yosifkit well you would argue that if you redistribute a piece of software, you'd have to provide a valid config for it. This is how for example packages work on a few operating systems. I do understand that the context is different here but I think there's some overlap in terms of responsibilities. Actually I don't see any particular config file in the Ghost repo, just an example file. Should the Docker image deal with that? |
We traditionally take the stance that if upstream supplies a "default
config", we use it. If they do not, but they do provide an example, we
take the example config and adapt it as lightly as possible (hence our
"sed" on top of the example file to create the initial configuration, which
works fine for development deployments). What we couldn't find was a cut
and dried "here's the optimal configuration you should use for your Ghost
deployments", so I'm very hesitant to make any further changes to that
example configuration without an explicit recommendation from upstream that
we ought to deviate.
|
See also the "haproxy" official image, which requires users to supply
the entire configuration or it won't even start -- haproxy is an
example where everyone's configuration is going to be so different
that it's not worth providing a default (since there's no one use case
that's significantly more common than others).
|
@tianon I do agree that this is a fiddly issue and all I'm looking for is a solution. Given that the |
Addressing the same issue. |
An easy solution I've found for this is to link to your content directory manually. This obviously isn't a long term fix though. Shouldn't the $GHOST_SOURCE/content directory just always be chowned to user so that directories like content/app/ are always writable? |
@lethjakman, the files in |
I have modified the Dockerfile to allow production and it seems to work:
|
What a mess this image is absolutely unusable for production !!!! |
This works
Thanks to http://stackoverflow.com/questions/31573337/can-you-pass-flags-to-the-command-that-docker-runs |
First of all thanks for providing this image. Despite issue we are discussing here, this is a great help.
This does not work because of @yosifkit Could you change the entrypoint such that it does not overwrite an existing config.js in the |
I have made my own workaround now and its working fine: Dockerfile
docker-entrypoint.shRemoved the whole "copy the config.js"-part
config.js
This keeps the content in the volume, but the |
Excellent, thanks @nknapp! blog:
container_name: blog.net
restart: always
image: ghost:0.11.4
depends_on:
- proxy
networks:
- nginx-proxy
volumes:
- /home/blog.net/content:/usr/src/ghost/content
- /home/blog.net/config.js:/usr/src/ghost/config.js
environment:
NODE_ENV: production
VIRTUAL_HOST: blog.net |
BTW: I have made a docker-compose setup here: https://github.com/containerize-my-server/ghost-mysql |
We had a similar conversations about Ghost V1. I propose to close this one. |
I've been using happily the
dockerfile/ghost
image for quite a while but unfortunately due to some strange behaviour, I can't pull down that container anymore. This means I need to migrate to the official ghost image. I was thinking "great, now there's an official image, it must be great!" however I have to say that I'm getting disappointing results so far.I can run a container just fine using the example commands in the README (which is for some strange reason decoupled from the actual images -- why?!) but when I am trying to run the app using the same parameters just with an extra environment variable passed down, the Ghost process quits:
I would really appreciate any help as this is getting really disappointing. There isn't any instruction in the README on how to run the app in production.
I am using docker 1.6.2 on an Ubuntu host:
Thank you.
The text was updated successfully, but these errors were encountered: