-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
27 lines (20 loc) · 762 Bytes
/
Copy pathentrypoint.sh
File metadata and controls
27 lines (20 loc) · 762 Bytes
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
set -e
APP_UID=${APP_UID:-1000}
APP_GID=${APP_GID:-1000}
# Ensure group exists
if ! getent group "${APP_GID}" >/dev/null; then
groupadd -g "${APP_GID}" appgroup
fi
# Ensure user exists
if ! id -u "${APP_UID}" >/dev/null 2>&1; then
useradd -u "${APP_UID}" -g "${APP_GID}" -m appuser
fi
mkdir -p /app/logs/requests /app/results /tmp/mplcache /models /config /tmp
chown -R "${APP_UID}:${APP_GID}" /app /models /config /tmp
# If mounted volumes override ownership, fix only log/result dirs
chown -R "${APP_UID}:${APP_GID}" /app/logs /app/results /tmp/mplcache || true
export LOG_DIR=${LOG_DIR:-/app/logs}
export RESULTS_DIR=${RESULTS_DIR:-/app/results}
export MPLCONFIGDIR=${MPLCONFIGDIR:-/tmp/mplcache}
exec gosu "${APP_UID}:${APP_GID}" "$@"