andrewrreed HF staff commited on
Commit
5266caf
·
1 Parent(s): 0a550c0

use TCP connection

Browse files
Files changed (1) hide show
  1. docker-entrypoint-wrapper.sh +5 -4
docker-entrypoint-wrapper.sh CHANGED
@@ -16,6 +16,7 @@ if [ ! -f "/data/postgresql/data/PG_VERSION" ]; then
16
  # Modify pg_hba.conf to allow local connections
17
  echo "local all all trust" > /data/postgresql/data/pg_hba.conf
18
  echo "host all all 127.0.0.1/32 trust" >> /data/postgresql/data/pg_hba.conf
 
19
  fi
20
 
21
  # Start PostgreSQL with the persistent directories
@@ -33,17 +34,17 @@ pg_ctl -D /data/postgresql/data -o "-c listen_addresses='*' -c unix_socket_direc
33
 
34
  # Create the 'node' database if it doesn't exist
35
  echo "Creating 'node' database if it doesn't exist..."
36
- createdb -h /data/postgresql/run node || true
37
 
38
  # Wait for PostgreSQL to be ready
39
  echo "Waiting for PostgreSQL to be ready..."
40
- until pg_isready -h /data/postgresql/run; do
41
  echo "Waiting for PostgreSQL to be ready..."
42
  sleep 1
43
  done
44
 
45
- # Update DATABASE_URL to use the correct socket directory and database name
46
- export DATABASE_URL="postgresql://postgres:postgres@%2Fdata%2Fpostgresql%2Frun:5432/node"
47
 
48
  # Run the original entrypoint script
49
  ./web/entrypoint.sh node ./web/server.js --keepAliveTimeout 110000
 
16
  # Modify pg_hba.conf to allow local connections
17
  echo "local all all trust" > /data/postgresql/data/pg_hba.conf
18
  echo "host all all 127.0.0.1/32 trust" >> /data/postgresql/data/pg_hba.conf
19
+ echo "host all all 0.0.0.0/0 trust" >> /data/postgresql/data/pg_hba.conf
20
  fi
21
 
22
  # Start PostgreSQL with the persistent directories
 
34
 
35
  # Create the 'node' database if it doesn't exist
36
  echo "Creating 'node' database if it doesn't exist..."
37
+ createdb -h localhost node || true
38
 
39
  # Wait for PostgreSQL to be ready
40
  echo "Waiting for PostgreSQL to be ready..."
41
+ until pg_isready -h localhost; do
42
  echo "Waiting for PostgreSQL to be ready..."
43
  sleep 1
44
  done
45
 
46
+ # Update DATABASE_URL to use TCP connection instead of Unix socket
47
+ export DATABASE_URL="postgresql://postgres:postgres@localhost:5432/node"
48
 
49
  # Run the original entrypoint script
50
  ./web/entrypoint.sh node ./web/server.js --keepAliveTimeout 110000