]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/docker/production/docker-entrypoint.sh
8ee968b3da833d9f9bbff3a62595b4a63c5030a8
[github/Chocobozzz/PeerTube.git] / support / docker / production / docker-entrypoint.sh
1 #!/bin/sh
2 set -e
3
4 # Populate config directory
5 if [ -z "$(ls -A /config)" ]; then
6 cp /app/support/docker/production/config/* /config
7 cp /app/config/default.yaml /config
8 chown -R peertube:peertube /config
9 fi
10
11 # first arg is `-f` or `--some-option`
12 # or first arg is `something.conf`
13 if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then
14 set -- npm "$@"
15 fi
16
17 # allow the container to be started with `--user`
18 if [ "$1" = 'npm' -a "$(id -u)" = '0' ]; then
19 chown -R peertube:peertube /data
20 exec gosu peertube "$0" "$@"
21 fi
22
23 exec "$@"