From 28faf322e2cc1729b61a7181ae0775380b2d3cb0 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sun, 6 Mar 2022 02:55:22 +0100 Subject: [PATCH] Add user for php docker container --- .docker/php.Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.docker/php.Dockerfile b/.docker/php.Dockerfile index 06d7e510..8d2a4f8d 100644 --- a/.docker/php.Dockerfile +++ b/.docker/php.Dockerfile @@ -2,7 +2,8 @@ FROM php:8.1.3-fpm-buster WORKDIR /app -RUN useradd -d /app -s /bin/bash runner +RUN groupadd -g 1000 runner +RUN useradd -u 1000 -g 1000 -d /app -s /bin/bash runner RUN sed -i 's/user = www-data/user = runner/' /usr/local/etc/php-fpm.d/www.conf RUN sed -i 's/group = www-data/group = runner/' /usr/local/etc/php-fpm.d/www.conf @@ -19,3 +20,4 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer RUN rm composer-setup.php +USER runner