orztv
commited on
Commit
·
a3a10fc
1
Parent(s):
b7f848a
update
Browse files- docker/startup.sh +3 -2
docker/startup.sh
CHANGED
@@ -33,8 +33,9 @@ if ! pg_isready -U nocodb; then
|
|
33 |
fi
|
34 |
|
35 |
log "检查并创建 PostgreSQL 数据库和用户..."
|
36 |
-
|
37 |
-
psql -U nocodb -
|
|
|
38 |
|
39 |
log "启动 Redis..."
|
40 |
redis-server /etc/redis.conf --port 6380 --daemonize yes
|
|
|
33 |
fi
|
34 |
|
35 |
log "检查并创建 PostgreSQL 数据库和用户..."
|
36 |
+
# 使用 template1 数据库来执行初始命令
|
37 |
+
psql -U nocodb -d template1 -c "SELECT 1 FROM pg_database WHERE datname = 'nocodb';" | grep -q 1 || psql -U nocodb -d template1 -c "CREATE DATABASE nocodb;"
|
38 |
+
psql -U nocodb -d template1 -c "ALTER USER nocodb WITH PASSWORD 'nocodb_password';"
|
39 |
|
40 |
log "启动 Redis..."
|
41 |
redis-server /etc/redis.conf --port 6380 --daemonize yes
|