mirror of
https://github.com/MrUnknownDE/unknownbin.git
synced 2026-04-06 00:32:08 +02:00
15 lines
618 B
Bash
15 lines
618 B
Bash
#!/bin/sh
|
|
|
|
# This script ensures that the 'data' directory is owned by the 'appuser'
|
|
# before the main application starts. This is crucial when using Docker volumes,
|
|
# as the mounted directory from the host will be owned by root inside the container.
|
|
|
|
# Set the ownership of the data directory to the non-root user.
|
|
# The '-R' flag makes it recursive.
|
|
chown -R appuser:appgroup /usr/src/app/data
|
|
|
|
# Execute the main command (passed as arguments to this script)
|
|
# as the non-root user 'appuser'.
|
|
# 'su-exec' is a lightweight tool to switch users.
|
|
# "$@" passes all arguments from the CMD line.
|
|
exec su-exec appuser "$@" |