|
| 1 | +FROM dunglas/frankenphp:1.8-php8.4 |
| 2 | + |
| 3 | +# change web server config |
| 4 | +COPY docker/frankenphp/Caddyfile /etc/caddy/Caddyfile |
| 5 | + |
| 6 | +# set document root to /app/public (Yii2 structure) |
| 7 | +WORKDIR /app |
| 8 | + |
| 9 | +# install required system packages for PHP extensions for Yii 2.0 Framework |
| 10 | +COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ |
| 11 | +RUN install-php-extensions \ |
| 12 | + bcmath \ |
| 13 | + @composer \ |
| 14 | + exif \ |
| 15 | + gd \ |
| 16 | + imagick \ |
| 17 | + intl \ |
| 18 | + opcache \ |
| 19 | + pdo_mysql \ |
| 20 | + pdo_pgsql \ |
| 21 | + soap \ |
| 22 | + xdebug \ |
| 23 | + zip |
| 24 | + |
| 25 | +# set composer environment |
| 26 | +ENV COMPOSER_ALLOW_SUPERUSER=1 |
| 27 | + |
| 28 | +# change PHP config |
| 29 | +COPY docker/php/php.ini /usr/local/etc/php/conf.d/base.ini |
| 30 | + |
| 31 | +# install supervisord and Node.js (includes npm) |
| 32 | +RUN apt-get update && apt-get install -y \ |
| 33 | + supervisor \ |
| 34 | + curl \ |
| 35 | + --no-install-recommends \ |
| 36 | + && curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \ |
| 37 | + && apt-get install -y nodejs \ |
| 38 | + && apt-get clean \ |
| 39 | + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 40 | + |
| 41 | +# copy supervisord config |
| 42 | +COPY docker/frankenphp/supervisord/supervisord.conf /etc/supervisor/supervisord.conf |
| 43 | + |
| 44 | +# copy supervisord program configs |
| 45 | +COPY docker/frankenphp/supervisord/conf.d/frankenphp.conf /etc/supervisor/conf.d/frankenphp.conf |
| 46 | + |
| 47 | +# copy queue worker config uncommented for use with yii2-queue |
| 48 | +#COPY docker/frankenphp/supervisord/conf.d/queue.conf /etc/supervisor/conf.d/queue.conf |
| 49 | + |
| 50 | +RUN mkdir -p /var/run && chown -R www-data:www-data /var/run |
| 51 | + |
| 52 | +# Run supervisord |
| 53 | +CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"] |
0 commit comments