diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-03-03 00:29:52 +0100 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2020-11-11 16:45:46 +0100 |
commit | 1a9b141d835cf3bfe9bdca67f881b520975f9058 (patch) | |
tree | 444b35656c7093250181121ccfadb870c5046be4 /support/docker/production/entrypoint.sh | |
parent | 8e98e6124d2b006ba9f616b0dfce7369fa7b2684 (diff) | |
download | PeerTube-1a9b141d835cf3bfe9bdca67f881b520975f9058.tar.gz PeerTube-1a9b141d835cf3bfe9bdca67f881b520975f9058.tar.zst PeerTube-1a9b141d835cf3bfe9bdca67f881b520975f9058.zip |
Add nginx behind traefik in docker-compose + image updates
- support/docker/production/docker-compose.yml: addition of a nginx
image reusing support/nginx/peertube nginx conf to improve performance,
and lessen setup differences between the docker-compose install and the
typical production install.
- support/docker/production/docker-compose.yml: postgres 10 -> postgres
12, redis 4 -> redis 5. Postgres major updates implies manual upgrade.
- support/nginx/peertube: HTTP -> HTTPS redirection is now commented
by default, to allow its reuse in support/docker/production/docker-compose.yml.
Diffstat (limited to 'support/docker/production/entrypoint.sh')
-rwxr-xr-x | support/docker/production/entrypoint.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/support/docker/production/entrypoint.sh b/support/docker/production/entrypoint.sh new file mode 100755 index 000000000..7dd626b9f --- /dev/null +++ b/support/docker/production/entrypoint.sh | |||
@@ -0,0 +1,26 @@ | |||
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 | fi | ||
8 | |||
9 | # Always copy default and custom env configuration file, in cases where new keys were added | ||
10 | cp /app/config/default.yaml /config | ||
11 | cp /app/support/docker/production/config/custom-environment-variables.yaml /config | ||
12 | find /config ! -user peertube -exec chown peertube:peertube {} \; | ||
13 | |||
14 | # first arg is `-f` or `--some-option` | ||
15 | # or first arg is `something.conf` | ||
16 | if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then | ||
17 | set -- npm "$@" | ||
18 | fi | ||
19 | |||
20 | # allow the container to be started with `--user` | ||
21 | if [ "$1" = 'npm' -a "$(id -u)" = '0' ]; then | ||
22 | find /data ! -user peertube -exec chown peertube:peertube {} \; | ||
23 | exec gosu peertube "$0" "$@" | ||
24 | fi | ||
25 | |||
26 | exec "$@" | ||