andrewrreed HF staff commited on
Commit
0a550c0
·
1 Parent(s): 5cf8a9a

creat node db

Browse files
Files changed (1) hide show
  1. docker-entrypoint-wrapper.sh +6 -2
docker-entrypoint-wrapper.sh CHANGED
@@ -31,6 +31,10 @@ fi
31
 
32
  pg_ctl -D /data/postgresql/data -o "-c listen_addresses='*' -c unix_socket_directories='/data/postgresql/run'" start
33
 
 
 
 
 
34
  # Wait for PostgreSQL to be ready
35
  echo "Waiting for PostgreSQL to be ready..."
36
  until pg_isready -h /data/postgresql/run; do
@@ -38,8 +42,8 @@ until pg_isready -h /data/postgresql/run; do
38
  sleep 1
39
  done
40
 
41
- # Update DATABASE_URL to use the correct socket directory
42
- export DATABASE_URL="postgresql://postgres:postgres@%2Fdata%2Fpostgresql%2Frun:5432/postgres"
43
 
44
  # Run the original entrypoint script
45
  ./web/entrypoint.sh node ./web/server.js --keepAliveTimeout 110000
 
31
 
32
  pg_ctl -D /data/postgresql/data -o "-c listen_addresses='*' -c unix_socket_directories='/data/postgresql/run'" start
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
 
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