You've already forked Php-Template
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 3m1s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 3m16s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 3m13s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 3m5s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 3m11s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 1m51s
Reviewed-on: #14 Co-authored-by: Ron Rise <ron@siteworxpro.com> Co-committed-by: Ron Rise <ron@siteworxpro.com>
41 lines
1.4 KiB
Docker
41 lines
1.4 KiB
Docker
# Use the RoadRunner image as a base for the first stage
|
|
FROM ghcr.io/roadrunner-server/roadrunner:2025.1.4 AS roadrunner
|
|
|
|
# Use the official Composer image as the base for the library stage
|
|
FROM siteworxpro/composer AS library
|
|
|
|
# Add Composer configuration files to the working directory
|
|
ADD composer.json composer.lock ./
|
|
|
|
# Install PHP dependencies, ignoring platform requirements and excluding development dependencies
|
|
RUN composer install --optimize-autoloader --ignore-platform-reqs --no-dev
|
|
|
|
|
|
# Use the official PHP CLI image with Alpine Linux for the second stage
|
|
FROM php:8.4.14-alpine AS php
|
|
|
|
# Move the production PHP configuration file to the default location
|
|
RUN mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \
|
|
&& apk add libpq-dev linux-headers --no-cache \
|
|
&& docker-php-ext-install pdo_pgsql sockets pcntl \
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
# Set the working directory to /app
|
|
WORKDIR /app
|
|
|
|
# Copy the RoadRunner binary from the first stage to the second stage
|
|
COPY --from=roadrunner /usr/bin/rr /usr/local/bin/rr
|
|
|
|
# Copy the installed PHP dependencies from the library stage
|
|
COPY --from=library /app/vendor /app/vendor
|
|
|
|
# Copy the RoadRunner configuration file and source
|
|
ADD src src/
|
|
ADD server.php .
|
|
ADD .rr.yaml .
|
|
ADD config.php .
|
|
|
|
EXPOSE 9501
|
|
|
|
# Entrypoint command to run the RoadRunner server with the specified configuration
|
|
ENTRYPOINT ["rr", "serve", "-c", ".rr.yaml", "-s"] |