Skip to content

Commit 7b8024e

Browse files
committed
drop privileges to APP_USER earlier to ensure stdout/stderr have correct perms
1 parent e953159 commit 7b8024e

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

Dockerfile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,21 @@ RUN for app in vod live; \
108108
# Copy our scripts, configs, templates, etc. into the container
109109
COPY --chown=$APP_USER WowzaStreamingEngine /usr/local/WowzaStreamingEngine
110110
COPY --chown=$APP_USER log4j-templates /opt/app/log4j-templates
111-
COPY --chown=$APP_USER etc_templates /opt/app/etc_templates
111+
COPY --chown=$APP_USER supervisor_templates /opt/app/supervisor_templates
112112
COPY --chown=$APP_USER bin /opt/app/bin
113113

114+
# create supervisord config files from templates
115+
RUN envsubst < \
116+
supervisor_templates/supervisord.conf.tmpl > \
117+
/etc/supervisor/supervisord.conf
118+
RUN envsubst < \
119+
supervisor_templates/conf.d/WowzaStreamingEngine.conf.tmpl > \
120+
/etc/supervisor/conf.d/WowzaStreamingEngine.conf
121+
RUN envsubst < \
122+
supervisor_templates/conf.d/WowzaStreamingEngineManager.conf.tmpl > \
123+
/etc/supervisor/conf.d/WowzaStreamingEngineManager.conf
124+
125+
114126
# =============================================================================
115127
# Additional Java libraries
116128

@@ -151,6 +163,8 @@ RUN apt-get remove -y zip
151163
# are dropped by supervisord instead of setting the `USER` set in the
152164
# Dockerfile.
153165

166+
USER $APP_USER
167+
154168
# =============================================================================
155169
# Default command
156170

bin/docker-entrypoint.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ export WSE_MGR_USER=$WOWZA_MANAGER_USER
3131
export WSE_MGR_PASS=$WOWZA_MANAGER_PASSWORD
3232
export WSE_LIC=$WOWZA_LICENSE_KEY
3333

34-
# use envsubst to transform templates into supervisord config files
35-
echo "Creating supervisord configuration files from templates..."
36-
envsubst < /opt/app/etc_templates/supervisor/supervisord.conf.tmpl > /etc/supervisor/supervisord.conf
37-
envsubst < /opt/app/etc_templates/supervisor/conf.d/WowzaStreamingEngine.conf.tmpl > /etc/supervisor/conf.d/WowzaStreamingEngine.conf
38-
envsubst < /opt/app/etc_templates/supervisor/conf.d/WowzaStreamingEngineManager.conf.tmpl > /etc/supervisor/conf.d/WowzaStreamingEngineManager.conf
39-
4034
# ########################################
4135
# Start server and manager by handing off to Wowza's entrypoint
4236

etc_templates/supervisor/conf.d/WowzaStreamingEngine.conf.tmpl renamed to supervisor_templates/conf.d/WowzaStreamingEngine.conf.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ command=/usr/local/WowzaStreamingEngine/bin/startup.sh
55
user=${APP_USER}
66
autostart=true
77
autorestart=true
8-
stdout_logfile=/usr/local/supervisor/supervisorStdOut.log
9-
stderr_logfile=/usr/local/supervisor/supervisorStdErr.log
8+
stdout_logfile=/dev/stdout
9+
stdout_logfile_maxbytes = 0
10+
stderr_logfile=/dev/stderr
11+
stderr_logfile_maxbytes = 0

etc_templates/supervisor/conf.d/WowzaStreamingEngineManager.conf.tmpl renamed to supervisor_templates/conf.d/WowzaStreamingEngineManager.conf.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ command=/usr/local/WowzaStreamingEngine/manager/bin/startmgr.sh
55
user=${APP_USER}
66
autostart=true
77
autorestart=true
8-
stdout_logfile=/usr/local/supervisor/supervisorStdOut.log
9-
stderr_logfile=/usr/local/supervisor/supervisorStdErr.log
8+
stdout_logfile=/dev/stdout
9+
stdout_logfile_maxbytes = 0
10+
stderr_logfile=/dev/stderr
11+
stderr_logfile_maxbytes = 0
File renamed without changes.

0 commit comments

Comments
 (0)