Skip to content

Commit

Permalink
Merge pull request #3 from teoincontatto/GermanDZ-dockerization
Browse files Browse the repository at this point in the history
Fixes for secret
  • Loading branch information
GermanDZ authored Jul 15, 2016
2 parents ad551e2 + 4274c26 commit 328ddbd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
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

0 comments on commit 328ddbd

Please sign in to comment.