From b5eabcb3111f3a28dcce0179b69d6b82f04e4a43 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sun, 17 Nov 2019 21:28:21 +0100 Subject: [PATCH] Create nginx user and group beforehand --- lxc-apps/decidim/lxc/etc/services.d/.s6-svscan/finish | 2 +- lxc-apps/decidim/lxcfile | 2 +- lxc-shared/alpine3.8-nginx/lxcfile | 5 +++++ lxc-shared/alpine3.8-php5.6/lxcfile | 2 +- lxc-shared/alpine3.9-nginx/lxcfile | 5 +++++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lxc-apps/decidim/lxc/etc/services.d/.s6-svscan/finish b/lxc-apps/decidim/lxc/etc/services.d/.s6-svscan/finish index 4da043c..db0b00c 100755 --- a/lxc-apps/decidim/lxc/etc/services.d/.s6-svscan/finish +++ b/lxc-apps/decidim/lxc/etc/services.d/.s6-svscan/finish @@ -1,4 +1,4 @@ #!/bin/execlineb -P -foreground { s6-svwait -d -t 3000 cts } +foreground { s6-svwait -d -t 3000 delayed_job } foreground { s6-svwait -d -t 3000 nginx } diff --git a/lxc-apps/decidim/lxcfile b/lxc-apps/decidim/lxcfile index 2df927e..ce345a2 100644 --- a/lxc-apps/decidim/lxcfile +++ b/lxc-apps/decidim/lxcfile @@ -43,7 +43,7 @@ RUN EOF bin/rails assets:precompile # Change ownership - chown -R www-data:www-data /srv/decidim-app + chown -R nginx:www-data /srv/decidim-app # Cleanup apk --no-cache del .deps diff --git a/lxc-shared/alpine3.8-nginx/lxcfile b/lxc-shared/alpine3.8-nginx/lxcfile index 4e629d1..77d9d4a 100644 --- a/lxc-shared/alpine3.8-nginx/lxcfile +++ b/lxc-shared/alpine3.8-nginx/lxcfile @@ -3,6 +3,11 @@ IMAGE alpine3.8-nginx_1.14.2-191115 LAYER alpine3.8_3.8.4-190620 RUN EOF + # Add nginx user (which will be picked up later by apk add) + addgroup -Sg 1080 nginx 2>/dev/null + adduser -Su 1080 -D -H -h /var/lib/nginx -s /sbin/nologin -G nginx -g nginx nginx 2>/dev/null + + # Install nginx apk --no-cache add nginx EOF diff --git a/lxc-shared/alpine3.8-php5.6/lxcfile b/lxc-shared/alpine3.8-php5.6/lxcfile index 5e99292..4446fad 100644 --- a/lxc-shared/alpine3.8-php5.6/lxcfile +++ b/lxc-shared/alpine3.8-php5.6/lxcfile @@ -4,7 +4,7 @@ LAYER alpine3.8_3.8.4-190620 LAYER alpine3.8-nginx_1.14.2-191115 RUN EOF - apk --no-cache add nginx php5 php5-ctype php5-fpm php5-gd php5-json php5-mcrypt php5-opcache + apk --no-cache add php5 php5-ctype php5-fpm php5-gd php5-json php5-mcrypt php5-opcache ln -s /usr/bin/php5 /usr/bin/php EOF diff --git a/lxc-shared/alpine3.9-nginx/lxcfile b/lxc-shared/alpine3.9-nginx/lxcfile index 097d36b..6f1df3d 100644 --- a/lxc-shared/alpine3.9-nginx/lxcfile +++ b/lxc-shared/alpine3.9-nginx/lxcfile @@ -3,6 +3,11 @@ IMAGE alpine3.9-nginx_1.14.2-191115 LAYER alpine3.9_3.9.4-190620 RUN EOF + # Add nginx user (which will be picked up later by apk add) + addgroup -Sg 1080 nginx 2>/dev/null + adduser -Su 1080 -D -H -h /var/lib/nginx -s /sbin/nologin -G nginx -g nginx nginx 2>/dev/null + + # Install nginx apk --no-cache add nginx EOF