Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
[FEATURE] Output unison output to docker logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mickaelperrin committed Aug 5, 2018
1 parent 46ded1d commit df31d63
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Dockerfile
Expand Up @@ -37,6 +37,11 @@ RUN apk add --no-cache curl \
&& curl -L https://github.com/jwilder/docker-gen/releases/download/$DOCKERGEN_VERSION/docker-gen-linux-amd64-$DOCKERGEN_VERSION.tar.gz | tar -C /usr/local/bin -xzv \
&& apk del curl

# Install supervisord-stdout
RUN apk add --no-cache py-pip \
&& pip install supervisor-stdout \
&& apk del py-pip

# Install entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN mkdir -p /sync-entrypoint.d \
Expand Down
10 changes: 9 additions & 1 deletion supervisor.unison.tpl.conf
Expand Up @@ -4,4 +4,12 @@ user=$user
environment=HOME="$homedir",USER="$user"
directory = $volume
redirect_stderr = true
autorestart=true
autorestart=true
stdout_events_enabled=true
stderr_events_enabled=true

[eventlistener:stdout]
command = supervisor_stdout
buffer_size = 100
events = PROCESS_LOG
result_handler = supervisor_stdout:event_handler
2 changes: 2 additions & 0 deletions supervisord.conf
Expand Up @@ -3,6 +3,8 @@ logfile=/tmp/supervisord.log
loglevel=info
pidfile=/tmp/supervisord.pid
nodaemon=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0

[unix_http_server]
file=/tmp/supervisor.sock
Expand Down

0 comments on commit df31d63

Please sign in to comment.