fix(docker): entrypoint chowns storage at container start
All checks were successful
Deploy Max Bot Test / deploy (push) Successful in 16s
All checks were successful
Deploy Max Bot Test / deploy (push) Successful in 16s
Stale app.log owned by UID 82 (from previous image) blocked the UID-1000 php-fpm workers from writing. Entrypoint fixes ownership on every start, surviving migrations. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,8 @@ RUN apk add --no-cache \
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
COPY docker/php/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
|
||||
# --- builder: composer install without dev deps, no scripts ---
|
||||
FROM base AS builder
|
||||
COPY composer.json composer.lock ./
|
||||
@@ -32,6 +34,7 @@ COPY public ./public
|
||||
COPY src ./src
|
||||
COPY storage ./storage
|
||||
|
||||
RUN chown -R www-data:www-data /var/www/html/storage
|
||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
CMD ["php-fpm"]
|
||||
|
||||
7
docker/php/entrypoint.sh
Executable file
7
docker/php/entrypoint.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
mkdir -p /var/www/html/storage/logs /var/www/html/storage/uploads
|
||||
chown -R www-data:www-data /var/www/html/storage
|
||||
|
||||
exec docker-php-entrypoint "$@"
|
||||
Reference in New Issue
Block a user