CyCoreSystems / docker-meteor

Dockerfile and script for running Meteor on Docker
MIT License
120 stars 73 forks source link

settings.json #25

Closed Antoine-O closed 7 years ago

Antoine-O commented 7 years ago

Hello ! Do you have a way to pass settings.xml ? (edit: I mistyped, I was talking about settings.json of course) thanks :)

Ulexus commented 7 years ago

I don't, as it has never fit into my workflow, but I can see its utility. Meteor can read the settings in from the METEOR_SETTINGS environment variable, so as far as I can see, we should be able to load the contexts of an arbitrary file into that environment variable to have it work.

I'm happy to take a PR for this.

Ulexus commented 7 years ago

I have added (to the v1.4 tag) support for SETTINGS_FILE and SETTINGS_URL, which attempt to load settings.json from a file or URL, respectively. I can't speak to XML support; I would not have presumed Meteor had anything XML-related, but whatever is in one of these sources is loaded into the METEOR_SETTINGS environment variable. Both are, by default, empty.

Example uses might be:

docker run -e SETTINGS_FILE=/data/config/app.json -v /data/config:/data/config ulexus/meteor:v1.4
docker run -e SETTINGS_URL=http://datasvr.mydomain.com/assets/app/settings.json ulexus/meteor:v1.4
Antoine-O commented 7 years ago

Sorry, mistyped for xml. Doing java and meteor may have cause this error 😀 Thanks!

Antoine-O commented 7 years ago

hey there !

I has to add

export METEOR_SETTINGS

just before nodes server launch otherwise the settings.json are not taking into account.

:)

Ulexus commented 7 years ago

Thanks @Antoine-O ; I have updated the entrypoint.sh to export METEOR_SETTINGS if it is set.

RobinVanCauter commented 7 years ago

@Ulexus Any chance this change might find it's way into the legacy image?

Ulexus commented 7 years ago

That sounds reasonable; I'll take a look at it when I return next week.