Closed Jackardios closed 6 months ago
Be sure you're calling docker-php-serversideup-set-file-permissions
when you're changing the user: https://serversideup.net/open-source/docker-php/docs/reference/command-reference#docker-php-serversideup-set-file-permissions
See the examples here: https://serversideup.net/open-source/docker-php/docs/guide/understanding-file-permissions
I'll re-open this issue if you're not able to get it to work 👍
@jaydrogers Thank you very much! Adding the docker-php-serversideup-set-file-permissions --owner $USER_ID:$GROUP_ID --service unit
command worked for me
Affected Docker Images
serversideup/php:beta-8.3-unit
Docker Labels of the affected images
No response
Current Behavior
after updating https://github.com/serversideup/docker-php/pull/311 an error appeared when starting the container:
Expected Behavior
The container should start without errors
Steps To Reproduce
FROM serversideup/php:beta-8.3-unit as base
USER root
Install dependencies needed inside base image
RUN apt-get update && apt-get install -y \ curl \ vim \ git \ wget \ zsh \ default-mysql-client \ && rm -rf /var/lib/apt/lists/*
Install and enable PHP extensions
RUN install-php-extensions \ apcu \ bcmath \ ctype \ curl \ exif \ gd \ imagick/imagick@master \ intl \ mbstring \ opcache \ pcntl \ pdo_mysql \ redis \ zip
Fix permission issues in development by setting the "www-data"
user to the same user and group that is running docker.
ARG USER_ID ARG GROUP_ID RUN docker-php-serversideup-set-id www-data ${USER_ID}:${GROUP_ID}
USER www-data
======================================================================================================================
--- Development ---
======================================================================================================================
FROM base as development
COPY ./docker/php/config/php-config.base.ini /usr/local/etc/php/conf.d/php-config.base.ini COPY ./docker/php/config/php-config.development.ini /usr/local/etc/php/conf.d/php-config.development.ini
WORKDIR /var/www/html
======================================================================================================================
--- Production ---
======================================================================================================================
FROM base as production
COPY ./docker/php/config/php-config.base.ini /usr/local/etc/php/conf.d/php-config.base.ini COPY ./docker/php/config/php-config.production.ini /usr/local/etc/php/conf.d/php-config.production.ini
WORKDIR /var/www/html
For security and isolation, instead of mounting the folder, we copy all files to the container
COPY --chown=www-data:www-data . /var/www/html
Run composer install
RUN VIEW_COMPILED_PATH=./ composer install --optimize-autoloader --apcu-autoloader --no-dev -n --no-progress && \ composer check-platform-reqs
Host Operating System
MacOS 14.3.1
Docker Version
Anything else?
No response