skills/php-deploy/SKILL.md
Build and deploy PHP applications — Composer, Laravel, Symfony, FrankenPHP, PHP-FPM, and Dockerfile patterns. Use when deploying a PHP project, or when composer.json or index.php is detected.
npx skillsauth add nixopus/agent php-deployInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Project is PHP if any of these exist:
composer.json at the build context rootindex.php at the rootPHP 8.2+ only.
composer.json → require.php (e.g. ">=8.2").php-version or mise.toml / .tool-versionsComposer. Detect composer.json and composer.lock.
| Has lock file | Command |
|---|---|
| yes | composer install --no-dev --optimize-autoloader |
| no | composer install --no-dev --optimize-autoloader |
Laravel and Symfony use public/. Generic PHP uses the project root.
Detected from composer.json → require section with ext-* entries.
| Signal | Framework |
|---|---|
| artisan | Laravel |
| symfony.lock or config/ structure | Symfony |
| wp-config.php | WordPress |
| index.php + routing | Generic PHP |
When artisan is present:
public/SKIP_MIGRATIONS=true.SKIP_MIGRATIONS=true)php artisan storage:link)php -S)Override by providing custom start-container.sh in project root.
If package.json detected alongside PHP (e.g. Laravel + Vite):
npm install or equivalentpackage.jsonCopy composer.json + composer.lock first for layer caching.
RUN --mount=type=cache,target=/root/.composer/cache \
composer install --no-dev --optimize-autoloader
| Use case | Image |
|---|---|
| FrankenPHP | dunglas/frankenphp:latest or dunglas/frankenphp:php8.4 |
| PHP-FPM | php:8.4-fpm-alpine |
| CLI / built-in server | php:8.4-cli-alpine |
FROM composer:2 AS deps
WORKDIR /app
COPY composer.json composer.lock ./
RUN composer install --no-dev --optimize-autoloader
FROM php:8.4-cli-alpine AS build
WORKDIR /app
COPY --from=deps /app/vendor ./vendor
COPY . .
RUN php artisan config:cache && php artisan route:cache && php artisan view:cache
FROM dunglas/frankenphp:php8.4
WORKDIR /app
COPY --from=build /app .
EXPOSE 8080
CMD ["frankenphp", "run", "--config", "/app/Caddyfile"]
FROM composer:2 AS deps
WORKDIR /app
COPY composer.json composer.lock ./
RUN composer install --no-dev --optimize-autoloader
FROM php:8.4-fpm-alpine
WORKDIR /app
COPY --from=deps /app/vendor ./vendor
COPY . .
EXPOSE 9000
CMD ["php-fpm"]
storage/ and bootstrap/cache/ must be writable — chown these directories in the Dockerfile for non-root userspost-autoload-dump scripts may fail during Docker build if the app isn't fully configured — use --no-scripts during install, then run composer dump-autoload --optimize after copying sourceopcache.enable=1, opcache.validate_timestamps=0) for significant performance gainsrequire as ext-* must be installed in the Docker image — they are not bundled with base PHP imagestools
Compressed catalog of all Nixopus API operations for the nixopus_api() tool
development
Deploy static file sites — Caddy/nginx serving, Staticfile config, and Dockerfile patterns. Use when deploying a static HTML site with no server-side runtime, or when index.html or a Staticfile is detected at the project root.
devops
Deploy shell script applications — interpreter detection, setup scripts, and Dockerfile patterns. Use when deploying a shell script project, or when start.sh is detected.
development
Self-healing loop for failed deployments — diagnose, fix, redeploy up to 3 attempts, then escalate or rollback. Load when a deployment fails or build errors occur.