Add user for php docker container

This commit is contained in:
philipp lang 2022-03-06 02:55:22 +01:00
parent 603da8a3fa
commit 28faf322e2
1 changed files with 3 additions and 1 deletions

View File

@ -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