Set an explicit username and password for the db service
This commit is contained in:
parent
2209b3a776
commit
a8888af480
@ -43,6 +43,9 @@ services:
|
||||
db:
|
||||
image: postgres:9.4
|
||||
container_name: db
|
||||
environment:
|
||||
POSTGRES_USER: "postgres"
|
||||
POSTGRES_PASSWORD: "postgres"
|
||||
volumes:
|
||||
- "db-data:/var/lib/postgresql/data"
|
||||
networks:
|
||||
@ -53,4 +56,4 @@ volumes:
|
||||
|
||||
networks:
|
||||
front-tier:
|
||||
back-tier:
|
||||
back-tier:
|
||||
|
@ -24,7 +24,7 @@ io.sockets.on('connection', function (socket) {
|
||||
});
|
||||
|
||||
var pool = new pg.Pool({
|
||||
connectionString: 'postgres://postgres@db/postgres'
|
||||
connectionString: 'postgres://postgres:postgres@db/postgres'
|
||||
});
|
||||
|
||||
async.retry(
|
||||
|
@ -16,7 +16,7 @@ namespace Worker
|
||||
{
|
||||
try
|
||||
{
|
||||
var pgsql = OpenDbConnection("Server=db;Username=postgres;");
|
||||
var pgsql = OpenDbConnection("Server=db;Username=postgres;Password=postgres;");
|
||||
var redisConn = OpenRedisConnection("redis");
|
||||
var redis = redisConn.GetDatabase();
|
||||
|
||||
@ -46,7 +46,7 @@ namespace Worker
|
||||
if (!pgsql.State.Equals(System.Data.ConnectionState.Open))
|
||||
{
|
||||
Console.WriteLine("Reconnecting DB");
|
||||
pgsql = OpenDbConnection("Server=db;Username=postgres;");
|
||||
pgsql = OpenDbConnection("Server=db;Username=postgres;Password=postgres;");
|
||||
}
|
||||
else
|
||||
{ // Normal +1 vote requested
|
||||
|
@ -72,7 +72,7 @@ class Worker {
|
||||
|
||||
while (conn == null) {
|
||||
try {
|
||||
conn = DriverManager.getConnection(url, "postgres", "");
|
||||
conn = DriverManager.getConnection(url, "postgres", "postgres");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Waiting for db");
|
||||
sleep(1000);
|
||||
|
Loading…
Reference in New Issue
Block a user