diff --git a/docker/common-setup.sh b/docker/common-setup.sh index e8e8ed2e..3530c97c 100755 --- a/docker/common-setup.sh +++ b/docker/common-setup.sh @@ -2,7 +2,7 @@ set -eu -install -m 775 -o leftypol -g leftypol -d /var/www +install -m 775 -o www-data -g www-data -d /var/www ln -s \ /code/banners/ \ /code/static/ \ @@ -16,16 +16,16 @@ ln -s \ /code/install.sql \ /var/www/ -install -m 775 -o leftypol -g leftypol -d /var/tmp/leftypol -install -m 775 -o leftypol -g leftypol -d /var/tmp/leftypol/cache +install -m 775 -o www-data -g www-data -d /var/tmp/leftypol +install -m 775 -o www-data -g www-data -d /var/tmp/leftypol/cache ln -s /var/tmp/leftypol /var/www/tmp -install -m 775 -o leftypol -g leftypol -d /var/www/js +install -m 775 -o www-data -g www-data -d /var/www/js ln -s /code/js/* /var/www/js/ -install -m 775 -o leftypol -g leftypol -d /var/www/templates -install -m 775 -o leftypol -g leftypol -d /var/www/templates/cache +install -m 775 -o www-data -g www-data -d /var/www/templates +install -m 775 -o www-data -g www-data -d /var/www/templates/cache ln -s /code/templates/* /var/www/templates/ -install -m 775 -o leftypol -g leftypol -d /var/www/inc +install -m 775 -o www-data -g www-data -d /var/www/inc ln -s /code/inc/* /var/www/inc/ diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile index e58381da..5fa002d3 100644 --- a/docker/nginx/Dockerfile +++ b/docker/nginx/Dockerfile @@ -1,11 +1,10 @@ FROM nginx:1.25.3-alpine COPY . /code -RUN addgroup --system leftypol \ - && adduser --system leftypol \ - && adduser leftypol leftypol \ - && /code/docker/common-setup.sh +RUN adduser --system www-data \ + && adduser www-data www-data \ + && /code/docker/common-setup.sh -CMD ["nginx", "-g", "daemon off;"] -EXPOSE 80 443 \ No newline at end of file +CMD [ "nginx", "-g", "daemon off;" ] +EXPOSE 80 diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index 89ac1ffc..7c6b6587 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -1,14 +1,16 @@ # This and proxy.conf are based on # https://github.com/dead-guru/devichan/blob/master/nginx/nginx.conf -user leftypol; +user www-data; worker_processes auto; error_log /dev/stdout warn; -pid /var/run/nginx.pid; +pid /var/run/nginx.pid; + events { worker_connections 1024; } + http { include /etc/nginx/mime.types; default_type application/octet-stream; diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index bbae84fd..962ef695 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -33,8 +33,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \ && pecl install imagick \ && pecl install -o -f igbinary \ && docker-php-ext-install gd zip opcache intl pdo pdo_mysql mysqli bcmath gettext iconv mbstring curl \ - && docker-php-ext-enable igbinary redis imagick \ - && useradd -MU leftypol + && docker-php-ext-enable igbinary redis imagick COPY --from=composer /usr/bin/composer /usr/bin/composer COPY . /code @@ -43,7 +42,6 @@ RUN /code/docker/common-setup.sh \ && ln -s /code/composer.json /code/composer.lock /var/www/ \ && cd /var/www && composer install -# RUN /code/docker/common-setup.sh php WORKDIR "/var/www" -CMD ["php-fpm"] +CMD [ "php-fpm" ] EXPOSE 9000 diff --git a/docker/php/www.conf b/docker/php/www.conf index 6a7ac20e..0f53aebf 100644 --- a/docker/php/www.conf +++ b/docker/php/www.conf @@ -1,6 +1,6 @@ [www] -user = leftypol -group = leftypol +user = www-data +group = www-data listen = 127.0.0.1:9000 pm = static pm.max_children = 16