genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
hs_monolith/start-db.sh

31 lines
711 B
Bash
Raw Normal View History

2017-03-01 22:07:08 +01:00
#!/bin/bash
2017-03-09 22:31:47 +01:00
2017-03-01 22:07:08 +01:00
[[ -n "$DOCKER_HOST" ]] && echo "DOCKER_HOST: $DOCKER_HOST"
2017-03-09 22:31:47 +01:00
if [[ ! -n "$LAB_MONOLITH_DB_HOST" ]]; then
echo 'ERROR: LAB_MONOLITH_DB_HOST is not set.'
2017-03-01 22:07:08 +01:00
exit 1
else
2017-03-09 22:31:47 +01:00
echo "LAB_MONOLITH_DB_HOST: $LAB_MONOLITH_DB_HOST"
2017-03-01 22:07:08 +01:00
fi
2017-03-09 22:31:47 +01:00
if [[ ! -n "$LAB_MONOLITH_DB_PORT" ]]; then
echo 'ERROR: LAB_MONOLITH_DB_PORT is not set.'
exit 1
else
echo "LAB_MONOLITH_DB_PORT: $LAB_MONOLITH_DB_PORT"
fi
2017-03-01 22:07:08 +01:00
if [[ ! -n "$LAB_MONOLITH_DB_PASSWORD" ]]; then
echo 'ERROR: LAB_MONOLITH_DB_PASSWORD is not set.'
exit 1
fi
2017-03-09 22:31:47 +01:00
echo 'Starting database...'
2017-03-01 22:07:08 +01:00
docker run --rm --name monolith-postgres\
2017-03-09 22:31:47 +01:00
-p $LAB_MONOLITH_DB_PORT:5432\
2017-03-01 22:07:08 +01:00
-e POSTGRES_USER=monolith\
-e POSTGRES_PASSWORD=$LAB_MONOLITH_DB_PASSWORD\
-d postgres:9