Created
November 23, 2013 21:43
-
-
Save mikeclarke/7620336 to your computer and use it in GitHub Desktop.
Wrapper script for dealing with environment variables set by the `-link container_name:db` argument. The Dockerfile `ENV` directive will set a static environment variable inside the container, but it's not possible to reference dynamic environment variables (at least not very easily) with ENV. This script should be set as the `ENTRYPOINT` in an …
This file contains 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 | |
# Docker doesn't have a great way to set runtime environment variables, | |
# so use this script to prepare the execution environnment for later processes. | |
export SQLALCHEMY_DATABASE_URI="postgresql://${DB_PORT_5432_TCP_ADDR}:5432/database_name" | |
# Execute the commands passed to this script | |
# e.g. "./env.sh venv/bin/nosetests --with-xunit | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment