Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for secret #3

Merged
merged 1 commit into from
Jul 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .docker/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

/toro_dist/setup.sh
/toro_dist/bin/torodb -c torodb.yml -l
/toro_dist/bin/torodb -c torodb.yml
10 changes: 8 additions & 2 deletions .docker/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

cp -r $(ls -d /toro/torodb-*-SNAPSHOT)/* /toro_dist

echo postgres:5432:*:postgres:$TOROPASS > ~/.pgpass
POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-}"
echo "postgres:5432:*:postgres:$POSTGRES_PASSWORD" > ~/.pgpass
chmod 400 ~/.pgpass
echo -n "Waiting PostgreSQL..."
while ! psql -h postgres -U postgres -c "SELECT 1" > /dev/null 2>&1
Expand All @@ -12,7 +13,12 @@ do
done
echo

psql -h postgres -U postgres -c "CREATE USER torodb WITH SUPERUSER PASSWORD '$TOROPASS'"
TORODB_PASSWORD="${TORODB_PASSWORD:-trustme}"
echo "postgres:5432:torod:torodb:$TORODB_PASSWORD" > ~/.toropass
chown 400 ~/.toropass
psql -h postgres -U postgres -c "CREATE USER torodb PASSWORD '$TORODB_PASSWORD'"
psql -h postgres -U postgres -c "CREATE DATABASE torod OWNER torodb"

rm ~/.pgpass
POSTGRES_PASSWORD=
TORODB_PASSWORD=
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ ADD .docker/run.sh /toro_dist
ADD .docker/torodb.yml /toro_dist
EXPOSE 27018

ENV TOROPASS trustme
CMD /toro_dist/run.sh
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
postgres:
image: postgres:9.5
environment:
- POSTGRES_PASSWORD=trustme
- POSTGRES_PASSWORD
ports:
- "5432:5432"
toro:
Expand All @@ -18,6 +18,9 @@ services:
- postgres
volumes:
- toro_build:/toro
environment:
- POSTGRES_PASSWORD
- TORODB_PASSWORD
toro_building:
build:
context: .
Expand Down