Fix su-exec to gosu for Debian
This commit is contained in:
+3
-3
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# entrypoint.sh -- fix volume ownership then drop to appuser
|
||||
# Runs as root (before USER appuser in Dockerfile) so it can chown.
|
||||
# The CMD is then exec'd as appuser via gosu/su-exec.
|
||||
# The CMD is then exec'd as appuser via gosu/gosu.
|
||||
set -e
|
||||
|
||||
# Fix ownership of bind-mounted volumes that may have been created by root.
|
||||
@@ -9,8 +9,8 @@ chown -R appuser:appuser /app/uploads /app/services/api/chroma_db 2>/dev/null ||
|
||||
|
||||
# Run migrations
|
||||
echo "[entrypoint] Running DB migrations..."
|
||||
su-exec appuser python /app/services/api/migrate.py
|
||||
gosu appuser python /app/services/api/migrate.py
|
||||
|
||||
# Hand off to the real command (uvicorn) as appuser
|
||||
echo "[entrypoint] Starting app as appuser..."
|
||||
exec su-exec appuser "$@"
|
||||
exec gosu appuser "$@"
|
||||
|
||||
Reference in New Issue
Block a user