]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/docker/production/entrypoint.sh
Merge branch 'release/5.1.0' into develop
[github/Chocobozzz/PeerTube.git] / support / docker / production / entrypoint.sh
CommitLineData
399d20ea
FP
1#!/bin/sh
2set -e
3
fd5e57bb 4
8d8a037e 5find /config ! -user peertube -exec chown peertube:peertube {} \; || true
b44a9630 6
399d20ea
FP
7# first arg is `-f` or `--some-option`
8# or first arg is `something.conf`
9if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then
5b2ede7d 10 set -- node "$@"
399d20ea
FP
11fi
12
13# allow the container to be started with `--user`
5b2ede7d 14if [ "$1" = 'node' -a "$(id -u)" = '0' ]; then
e902e03f 15 find /data ! -user peertube -exec chown peertube:peertube {} \;
4aeb67a5 16 exec gosu peertube "$0" "$@"
399d20ea
FP
17fi
18
19exec "$@"