From 017baf57d50b63cd32dce44e7b953f6ac6380c0b Mon Sep 17 00:00:00 2001 From: Angristan Date: Sun, 11 Mar 2018 21:06:14 +0100 Subject: [PATCH] Nginx logs to stdout for Docker Alpine images --- docker/alpine/Dockerfile.armhf.latest | 4 +++- docker/alpine/Dockerfile.armhf.master | 4 +++- docker/alpine/Dockerfile.latest | 5 ++++- docker/alpine/Dockerfile.master | 5 ++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docker/alpine/Dockerfile.armhf.latest b/docker/alpine/Dockerfile.armhf.latest index c923834a..824a1926 100644 --- a/docker/alpine/Dockerfile.armhf.latest +++ b/docker/alpine/Dockerfile.armhf.latest @@ -37,7 +37,9 @@ RUN curl -L https://github.com/shaarli/Shaarli/archive/latest.tar.gz | tar xzf - && cd shaarli \ && composer --prefer-dist --no-dev install \ && rm -rf ~/.composer \ - && chown -R nginx:nginx . + && chown -R nginx:nginx . \ + && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \ + && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log VOLUME /var/www/shaarli/data diff --git a/docker/alpine/Dockerfile.armhf.master b/docker/alpine/Dockerfile.armhf.master index 7f1bdf85..6c89adc3 100644 --- a/docker/alpine/Dockerfile.armhf.master +++ b/docker/alpine/Dockerfile.armhf.master @@ -37,7 +37,9 @@ RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - && cd shaarli \ && composer --prefer-dist --no-dev install \ && rm -rf ~/.composer \ - && chown -R nginx:nginx . + && chown -R nginx:nginx . \ + && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \ + && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log VOLUME /var/www/shaarli/data diff --git a/docker/alpine/Dockerfile.latest b/docker/alpine/Dockerfile.latest index 4724b633..755d8751 100644 --- a/docker/alpine/Dockerfile.latest +++ b/docker/alpine/Dockerfile.latest @@ -42,7 +42,10 @@ RUN rm -rf /etc/php7/php-fpm.d/www.conf \ WORKDIR /var/www COPY --from=composer /app/shaarli shaarli -RUN chown -R nginx:nginx . +RUN chown -R nginx:nginx . \ + && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \ + && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log + VOLUME /var/www/shaarli/data EXPOSE 80 diff --git a/docker/alpine/Dockerfile.master b/docker/alpine/Dockerfile.master index 9cb4dec4..0472947f 100644 --- a/docker/alpine/Dockerfile.master +++ b/docker/alpine/Dockerfile.master @@ -42,7 +42,10 @@ RUN rm -rf /etc/php7/php-fpm.d/www.conf \ WORKDIR /var/www COPY --from=composer /app/shaarli shaarli -RUN chown -R nginx:nginx . +RUN chown -R nginx:nginx . \ + && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \ + && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log + VOLUME /var/www/shaarli/data EXPOSE 80 -- 2.41.0