From 31520c2cb15397c7263be2c1f5373cc605930fa1 Mon Sep 17 00:00:00 2001 From: mirsal Date: Fri, 16 Jul 2021 21:03:02 +0000 Subject: [PATCH] fix: Copy the client assets over to a named volume at runtime This commit makes the entrypoint copy the client's dist files to the mountpoint of the app-assets named volume. That way, changed files are made available to the nginx container when the peertube image gets updated Closes: #8 --- abra.sh | 2 +- compose.yml | 2 +- entrypoint.sh | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/abra.sh b/abra.sh index a997bc0..448cce9 100644 --- a/abra.sh +++ b/abra.sh @@ -1,7 +1,7 @@ # shellcheck disable=SC2034,SC2145 export NGINX_CONFIG_VERSION=v2 -export APP_ENTRYPOINT_VERSION=v1 +export APP_ENTRYPOINT_VERSION=v2 sub_npm() { abra__service_="app" diff --git a/compose.yml b/compose.yml index 542843a..c282f36 100644 --- a/compose.yml +++ b/compose.yml @@ -51,7 +51,7 @@ services: volumes: - app-data:/data - app-config:/config - - app-assets:/app/client/dist + - app-assets:/srv/client/dist secrets: - db_password configs: diff --git a/entrypoint.sh b/entrypoint.sh index 06eccd6..7175127 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -30,6 +30,10 @@ if [ -z "$PEERTUBE_SMTP_ENABLED" ]; then file_env "PEERTUBE_SMTP_PASSWORD" fi +# Copy the client files over to a named volume +# so that they may be served by nginx directly +cp -ar /app/client/dist /srv/client + # upstream entrypoint # https://github.com/Chocobozzz/PeerTube/blob/66f77f63437c6774acbd72584a9839a7636ea167/support/docker/production/entrypoint.sh /usr/local/bin/entrypoint.sh "$@" -- 2.40.1