File size: 654 Bytes
ee6ea45 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#!/bin/bash
# 确保以 postgres 用户身份运行
if [ "$(id -u)" -ne 1000 ]; then
echo "切换到 UID 为 1000 的 postgres 用户运行"
exec gosu postgres "$0" "$@"
fi
# 启动 PostgreSQL 服务
docker-entrypoint.sh postgres &
# 检查 PostgreSQL 服务是否已启动
echo "等待 PostgreSQL 服务启动..."
until pg_isready -h localhost; do
sleep 5
done
echo "PostgreSQL 服务已启动!"
# export N8N_USER_FOLDER=${DATA_DIR}
export N8N_ENCRYPTION_KEY="n8n8n8n"
# Allows usage of all builtin modules
export NODE_FUNCTION_ALLOW_BUILTIN=*
# Allow usage of external npm modules.
export NODE_FUNCTION_ALLOW_EXTERNAL=*
# 启动 n8n
exec n8n |