orztv
commited on
Commit
·
59620c3
1
Parent(s):
210b72b
update
Browse files- Dockerfile +3 -1
- docker/startup.sh +4 -0
Dockerfile
CHANGED
@@ -13,7 +13,9 @@ RUN adduser -D -u 1000 nocodb && \
|
|
13 |
sed -i 's/# requirepass foobared/requirepass redis_password/' /etc/redis.conf && \
|
14 |
sed -i 's/bind 127.0.0.1/bind 0.0.0.0/' /etc/redis.conf && \
|
15 |
sed -i 's/dir .\//dir \/usr\/app\/data\//' /etc/redis.conf && \
|
16 |
-
sed -i 's/logfile ""/logfile "\/var\/log\/redis\/redis.log"/' /etc/redis.conf
|
|
|
|
|
17 |
|
18 |
# 复制启动脚本并设置权限
|
19 |
COPY docker/startup.sh /usr/src/appEntry/startup.sh
|
|
|
13 |
sed -i 's/# requirepass foobared/requirepass redis_password/' /etc/redis.conf && \
|
14 |
sed -i 's/bind 127.0.0.1/bind 0.0.0.0/' /etc/redis.conf && \
|
15 |
sed -i 's/dir .\//dir \/usr\/app\/data\//' /etc/redis.conf && \
|
16 |
+
sed -i 's/logfile ""/logfile "\/var\/log\/redis\/redis.log"/' /etc/redis.conf && \
|
17 |
+
chmod 644 /etc/redis.conf && \
|
18 |
+
chown -R nocodb:nocodb /etc/redis.conf /var/log/redis
|
19 |
|
20 |
# 复制启动脚本并设置权限
|
21 |
COPY docker/startup.sh /usr/src/appEntry/startup.sh
|
docker/startup.sh
CHANGED
@@ -42,6 +42,8 @@ log "启动 Redis..."
|
|
42 |
ls -l /etc/redis.conf
|
43 |
# 检查 Redis 日志目录权限
|
44 |
ls -l /var/log/redis
|
|
|
|
|
45 |
# 尝试以当前用户启动 Redis
|
46 |
redis-server /etc/redis.conf --port 6380 --daemonize yes
|
47 |
|
@@ -58,6 +60,8 @@ done
|
|
58 |
if ! redis-cli -p 6380 ping; then
|
59 |
log "Redis 启动失败,查看日志:"
|
60 |
cat /var/log/redis/redis.log
|
|
|
|
|
61 |
exit 1
|
62 |
fi
|
63 |
|
|
|
42 |
ls -l /etc/redis.conf
|
43 |
# 检查 Redis 日志目录权限
|
44 |
ls -l /var/log/redis
|
45 |
+
# 检查 Redis 数据目录权限
|
46 |
+
ls -l /usr/app/data
|
47 |
# 尝试以当前用户启动 Redis
|
48 |
redis-server /etc/redis.conf --port 6380 --daemonize yes
|
49 |
|
|
|
60 |
if ! redis-cli -p 6380 ping; then
|
61 |
log "Redis 启动失败,查看日志:"
|
62 |
cat /var/log/redis/redis.log
|
63 |
+
log "Redis 进程状态:"
|
64 |
+
ps aux | grep redis-server
|
65 |
exit 1
|
66 |
fi
|
67 |
|