do not be root
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Torma Kristóf 2020-09-20 03:12:53 +02:00
parent adabd152c8
commit 59b1ab9f82

View File

@ -3,6 +3,9 @@ FROM buildpack-deps:stable
ENV NGINX_VERSION nginx-1.19.2 ENV NGINX_VERSION nginx-1.19.2
ENV NGINX_RTMP_MODULE_VERSION 1.2.1 ENV NGINX_RTMP_MODULE_VERSION 1.2.1
ADD startscript.sh /usr/sbin/startscript.sh
ADD config /etc/nginx/
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y ca-certificates openssl libssl-dev ffmpeg && \ apt-get install -y ca-certificates openssl libssl-dev ffmpeg && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \
@ -38,11 +41,12 @@ RUN apt-get update && \
mkdir /var/lock/nginx && \ mkdir /var/lock/nginx && \
rm -rf /tmp/build && \ rm -rf /tmp/build && \
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 && \
useradd -r -d /var/cache/nginx/ -s /sbin/nologin -U nginx && \
ADD startscript.sh /usr/sbin/startscript.sh ln -sf /usr/lib64/nginx/modules /etc/nginx/modules && \
ADD config /etc/nginx/ chown R nginx:users /etc/nginx
USER nginx:users
EXPOSE 1935 EXPOSE 1935
CMD ["bash", "/usr/sbin/startscript.sh"] CMD ["bash", "/usr/sbin/startscript.sh"]