Fix file upload limit over 2MB in production with HTTPS

- Use printf instead of echo to correctly write php.ini with newlines
  (Alpine ash echo does not interpret \n, leaving the file malformed
  and PHP falling back to its 2MB default)
- Add nginx.conf with client_max_body_size 25M as front-end proxy
- Start nginx on port 8080 via supervisord; move artisan serve to
  internal port 8081 so nginx can proxy requests with proper limits

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 07:41:52 -06:00
parent e7ca2c29f0
commit ff5b6f5eec
3 changed files with 36 additions and 2 deletions
+2 -1
View File
@@ -17,8 +17,9 @@ RUN mkdir -p storage/framework/{sessions,views,cache} \
RUN php artisan storage:link
RUN echo "upload_max_filesize=20M\npost_max_size=25M" > /app/php.ini
RUN printf "upload_max_filesize=20M\npost_max_size=25M\n" > /app/php.ini
COPY nginx.conf /etc/nginx/nginx.conf
COPY supervisord.conf /etc/supervisord.conf
EXPOSE 8080