16 lines
445 B
Bash
16 lines
445 B
Bash
#!/bin/sh
|
|
# Exit on error
|
|
set -e
|
|
|
|
# Use PUID/PGID from environment variables, or default to 1000
|
|
PUID=${PUID:-1000}
|
|
PGID=${PGID:-1000}
|
|
|
|
# Set ownership of the data directory
|
|
# This ensures that the user running the container can write to the volume
|
|
chown -R "$PUID:$PGID" /app/data
|
|
|
|
# Drop root privileges and execute the main command (CMD)
|
|
# The command (e.g., uvicorn) is passed as arguments to this script ("$@")
|
|
exec gosu "$PUID:$PGID" "$@"
|