Here is an example of a Dockerfile that can be used to build a Docker image with RoadRunner for a PHP application:
Note that this example utilizes a folder named app for your application. If your application is located in a different folder, feel free to customize this Dockerfile to suit your needs.
Dockerfile
FROM ghcr.io/roadrunner-server/roadrunner:2024 as roadrunnerFROM php:8.3-alpine# https://github.com/mlocati/docker-php-extension-installer# https://github.com/docker-library/docs/tree/0fbef0e8b8c403f581b794030f9180a68935af9d/php#how-to-install-more-php-extensionsRUN --mount=type=bind,from=mlocati/php-extension-installer:2,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \ install-php-extensions @composer-2 opcache zip intl sockets protobufCOPY --from=roadrunner /usr/bin/rr /usr/local/bin/rrEXPOSE 8080/tcpWORKDIR /appENV COMPOSER_ALLOW_SUPERUSER=1# Copy composer files from app directory to install dependenciesCOPY ./app/composer.* .RUN composer install --optimize-autoloader --no-dev# Copy application filesCOPY ./app .# Run RoadRunner serverCMD ./rr serve -c .rr.yaml