nginx: fix user id for nginx, remove collectd

single-dockerfile
Trammell Hudson 2 years ago
parent 27dd1a64bd
commit b4ec015e62
  1. 9
      nginx/Dockerfile
  2. 12
      nginx/docker-entrypoint.d/01-collectd.sh

@ -1,14 +1,15 @@
FROM alpine FROM alpine
RUN apk update RUN apk update
RUN echo "building" \ RUN echo "image update" \
&& apk add \ && apk add \
nginx \ nginx \
collectd \
collectd-nginx \
nginx-mod-http-vts \ nginx-mod-http-vts \
gettext \ gettext \
curl \ curl \
openssl \ openssl \
&& echo "packages installed"
RUN echo "configuring" \
&& mkdir -p \ && mkdir -p \
/etc/nginx/modules-enabled \ /etc/nginx/modules-enabled \
/etc/nginx/conf.d \ /etc/nginx/conf.d \
@ -17,6 +18,8 @@ RUN echo "building" \
# forward request and error logs to docker log collector # forward request and error logs to docker log collector
&& ln -sf /dev/stdout /var/log/nginx/access.log \ && ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \ && ln -sf /dev/stderr /var/log/nginx/error.log \
&& sed -i -e 's/nginx:x:101:102/nginx:x:33:33/' '/etc/passwd' \
&& chown -R 33:33 /var/lib/nginx \
&& echo "Done" && echo "Done"
COPY ["docker-entrypoint.d/*", "/docker-entrypoint.d/" ] COPY ["docker-entrypoint.d/*", "/docker-entrypoint.d/" ]

@ -1,12 +0,0 @@
#!/bin/sh -x
touch /started
#cat >> /etc/collectd/collectd.conf <<EOF
cat /etc/collectd/collectd.conf - > /tmp/conf <<EOF
LoadPlugin nginx
<Plugin "nginx">
URL "http://localhost:80/nginx_status"
</Plugin>
EOF
#collectd
Loading…
Cancel
Save