diff --git a/Dockerfile b/Dockerfile index 3bd912b..1121edb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,17 +9,29 @@ RUN set -ex \ /tmp/dumb-init -FROM alpine:latest +FROM luzifer/arch-repo-builder as aur + +ENV SKIP_VERIFY=true RUN set -ex \ - && apk --no-cache add \ + && pacman -Syu --noconfirm nginx \ + && /usr/local/bin/run.sh "https://aur.archlinux.org/nginx-mod-rtmp.git" \ + && cp git/nginx-mod-rtmp-*.pkg.tar.xz /tmp/nginx-mod-rtmp.pkg.tar.xz + + +FROM luzifer/archlinux:latest + +COPY --from=aur /tmp/nginx-mod-rtmp.pkg.tar.xz /tmp/ + +RUN set -ex \ + && pacman -Syu --noconfirm \ bash \ nginx \ - nginx-mod-rtmp + && pacman -U --noconfirm /tmp/nginx-mod-rtmp.pkg.tar.xz -COPY --from=fetch /tmp/dumb-init /usr/local/bin/ -COPY docker-entrypoint.sh /usr/local/bin/ -COPY nginx.conf /etc/nginx/nginx.conf +COPY --from=fetch /tmp/dumb-init /usr/local/bin/ +COPY docker-entrypoint.sh /usr/local/bin/ +COPY nginx.conf /etc/nginx/nginx.conf EXPOSE 80 1935 VOLUME ["/data"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index e5ade26..467fb34 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -2,6 +2,7 @@ set -euxo pipefail # Ensure nginx can work with the /data dir -chown -R nginx: /data +chown -R http /data +chgrp -R http /data exec nginx -g "daemon off;" diff --git a/nginx.conf b/nginx.conf index 3ad307c..f7d9e68 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,11 +1,11 @@ -user nginx; +user http; worker_processes auto; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; -include /etc/nginx/modules/rtmp.conf; +load_module /usr/lib/nginx/modules/ngx_rtmp_module.so; events { worker_connections 1024; @@ -40,6 +40,8 @@ http { } rtmp { + access_log off; + server { listen 1935;