cjovs commited on
Commit
5565702
·
1 Parent(s): 126ef31

fix: resolve RUNTIME_ERROR caused by FUSE bucket mount conflicts

Browse files

- Move REDIS_DIR from /app/data/redis (FUSE bucket mount) to /tmp/redis
- Add 2>/dev/null || true to mkdir to survive FUSE mount errors under set -e
- Wrap chown in background job with 2s timeout to prevent hang on bucket mount

Files changed (1) hide show
  1. deploy/docker-entrypoint.sh +6 -4
deploy/docker-entrypoint.sh CHANGED
@@ -5,12 +5,14 @@ PGDATA="/tmp/pgdata"
5
  PGUSER="postgres"
6
  PGPASS="postgres"
7
  PGDB="su2adb"
8
- REDIS_DIR="/app/data/redis"
9
  BUCKET_DUMP="hf://buckets/cjovs/su2a-data/su2adb_dump.sql"
10
 
11
  if [ "$(id -u)" = "0" ]; then
12
- mkdir -p /app/data/redis
13
- chown -R su2a:su2a /app/data 2>/dev/null || true
 
 
14
  exec su-exec su2a "$0" "$@"
15
  fi
16
 
@@ -51,7 +53,7 @@ fi
51
  echo "[pg] Database $PGDB ready."
52
 
53
  echo "=== Starting Redis ==="
54
- mkdir -p "$REDIS_DIR"
55
  redis-server --daemonize yes --dir "$REDIS_DIR" --save "" --port 6379 --bind 127.0.0.1
56
  echo "[redis] Redis started."
57
 
 
5
  PGUSER="postgres"
6
  PGPASS="postgres"
7
  PGDB="su2adb"
8
+ REDIS_DIR="/tmp/redis"
9
  BUCKET_DUMP="hf://buckets/cjovs/su2a-data/su2adb_dump.sql"
10
 
11
  if [ "$(id -u)" = "0" ]; then
12
+ mkdir -p /tmp/redis 2>/dev/null || true
13
+ chown -R su2a:su2a /app/data 2>/dev/null &
14
+ sleep 2
15
+ kill %1 2>/dev/null || true
16
  exec su-exec su2a "$0" "$@"
17
  fi
18
 
 
53
  echo "[pg] Database $PGDB ready."
54
 
55
  echo "=== Starting Redis ==="
56
+ mkdir -p "$REDIS_DIR" 2>/dev/null || true
57
  redis-server --daemonize yes --dir "$REDIS_DIR" --save "" --port 6379 --bind 127.0.0.1
58
  echo "[redis] Redis started."
59