]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/docker/production/entrypoint.sh
Fix logger warning level
[github/Chocobozzz/PeerTube.git] / support / docker / production / entrypoint.sh
CommitLineData
399d20ea
FP
1#!/bin/sh
2set -e
3
fd5e57bb
C
4# Populate config directory
5if [ -z "$(ls -A /config)" ]; then
6 cp /app/support/docker/production/config/* /config
fd5e57bb
C
7fi
8
0c985c5a 9# Always copy default and custom env configuration file, in cases where new keys were added
b44a9630 10cp /app/config/default.yaml /config
df9e1d69 11cp /app/support/docker/production/config/custom-environment-variables.yaml /config
e902e03f 12find /config ! -user peertube -exec chown peertube:peertube {} \;
b44a9630 13
399d20ea
FP
14# first arg is `-f` or `--some-option`
15# or first arg is `something.conf`
16if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then
4aeb67a5 17 set -- npm "$@"
399d20ea
FP
18fi
19
20# allow the container to be started with `--user`
33837e8b 21if [ "$1" = 'npm' -a "$(id -u)" = '0' ]; then
e902e03f 22 find /data ! -user peertube -exec chown peertube:peertube {} \;
4aeb67a5 23 exec gosu peertube "$0" "$@"
399d20ea
FP
24fi
25
26exec "$@"