This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| : "${FORKED:=}" | |
| if [ -z "${FORKED}" ]; then | |
| echo >&2 'mongod for initdb is going to shutdown' | |
| mongod --pidfilepath /tmp/docker-entrypoint-temp-mongod.pid --shutdown | |
| echo >&2 'replica set will be initialized later' | |
| FORKED=1 "${BASH_SOURCE[0]}" & | |
| unset FORKED | |
| mongodHackedArgs=(:) # bypass mongod --shutdown in docker-entrypoint.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Pass the env-vars to MYCOMMAND | |
| eval $(egrep -v '^#' .env | xargs) MYCOMMAND | |
| # … or ... | |
| # Export the vars in .env into your shell: | |
| export $(egrep -v '^#' .env | xargs) |