Skip to content

Instantly share code, notes, and snippets.

Created Nov 23, 2013
What would you like to do?
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 …
# 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. "./ venv/bin/nosetests --with-xunit
exec "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment