Skip to content

check directories one by one and not depend only on config.js#6

Merged
tianon merged 1 commit intodocker-library:masterfrom
soupdiver:separate_init_checks
Apr 6, 2015
Merged

check directories one by one and not depend only on config.js#6
tianon merged 1 commit intodocker-library:masterfrom
soupdiver:separate_init_checks

Conversation

@soupdiver
Copy link
Contributor

As mentioned in #5 this change introduces a less radical init process checking and gives you the opportunity to inject your own config.js from a data-only container, which should be responsible for holding the state. Otherwise it would not be possible to upgrade the image the container is running on without losing your current state.

This solution still has problems because of the way the container start is handled in general.

The config.example.js does not include the paths attribute for the production environment and so it is not "fixed" in the way the development environment is with the sed command in docker-entrypoint.sh

That's why the container start fails when giving NODE_ENV=production.
If you put a correct config.js in a container from which you get the volumes before the first start, the container crashes because the subfolders of the GHOST_CONTENT dir were not initialised. This is because a config.js was found and the init phase is totally skipped.

This is fixed in this PR.

Anyway you have to pay attention to also "fix" the paths for other environments manually because the automatism via sed is only run when als the config.js is initialsed automatically which again leads to the production environment problem.

So that's all a bit hacky because the original config.example.js is incomplete and needs manual adjustment to work in production.

@yosifkit
Copy link
Member

yosifkit commented Apr 6, 2015

LGTM

@tianon
Copy link
Member

tianon commented Apr 6, 2015

Seems sane. 👍

LGTM

tianon added a commit that referenced this pull request Apr 6, 2015
check directories one by one and not depend only on config.js
@tianon tianon merged commit 6fe66a2 into docker-library:master Apr 6, 2015
@tianon
Copy link
Member

tianon commented Apr 6, 2015

Do we have any documentation we can point to upstream to note that this is the full list of possible directories in content?

@soupdiver
Copy link
Contributor Author

I just picked the directories which are present there: https://github.com/TryGhost/Ghost/tree/master/content

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

Successfully merging this pull request may close these issues.

3 participants