ff5b6f5eec
- 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>
28 lines
748 B
Docker
28 lines
748 B
Docker
FROM php:8.2-fpm-alpine
|
|
|
|
RUN apk add --no-cache nginx nodejs npm supervisor \
|
|
&& docker-php-ext-install pdo pdo_mysql mysqli bcmath pcntl
|
|
|
|
WORKDIR /app
|
|
COPY . .
|
|
|
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
RUN composer install --optimize-autoloader
|
|
|
|
RUN npm ci && npm run build
|
|
|
|
RUN mkdir -p storage/framework/{sessions,views,cache} \
|
|
&& mkdir -p storage/app/livewire-tmp \
|
|
&& chmod -R 775 storage bootstrap/cache
|
|
|
|
RUN php artisan storage:link
|
|
|
|
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
|
|
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
|