forked from KoljaB/RealtimeVoiceChat
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentrypoint.sh
More file actions
19 lines (14 loc) · 897 Bytes
/
entrypoint.sh
File metadata and controls
19 lines (14 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
set -e # Good practice: exit script if any command fails.
# This script runs as root # Correct assumption based on Dockerfile changes.
echo "Entrypoint: Ensuring cache directory ownership for user appuser (1001)..." # Informative log.
# Ensure the target directories exist. Runs as root, so has permission.
mkdir -p /home/appuser/.cache/huggingface /home/appuser/.cache/torch
# Chown command runs as root and should succeed now.
# Uses UID:GID which is robust. Targets the parent .cache dir recursively.
chown -R 1001:1001 /home/appuser/.cache
echo "Entrypoint: Switching to user appuser (1001) and executing command: $@" # Informative log.
# Drop privileges using gosu before executing the CMD passed as arguments ($@).
# 'gosu appuser' finds the user named 'appuser' (which is UID 1001).
# 'exec' replaces the script process with the application process.
exec gosu appuser "$@"