autopilotpattern / mongodb

A robust and highly-scalable implementation of MongoDB in Docker using the Autopilot Pattern
Mozilla Public License 2.0
42 stars 20 forks source link

Ability to customize "--replSet" via environment variable instead of command #6

Open tianon opened 7 years ago

tianon commented 7 years ago

Currently, to modify the value of --replSet, one has to replace the entire image command, ala: https://github.com/autopilotpattern/mongodb/blob/a862b1d630d460280eb41264cd22160c40f1f83d/local-compose.yml#L5

        command: containerpilot mongod --replSet=pilot

This is a bit fragile for users who might want to specify not only a custom --replSet, but possibly also other mongod arguments, especially if we end up needing to change the default image command at some point too (for whatever reason).

It'd be nice if this could be specified somehow via environment variable to override the current default value of joyent to avoid these issues (although that does get us into a bit of a catch-22 with https://github.com/joyent/containerpilot/issues/126 -- possibly most easily solved via a short wrapper script to run in front of/in place of mongod).

leoj3n commented 5 years ago

I think your env var recommendation has been implemented, which is why I made PR https://github.com/autopilotpattern/mongodb/pull/19.