diff --git a/Dockerfile b/Dockerfile index 6b3688c..cbda9a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,6 +51,9 @@ RUN apt update \ FROM base AS dev +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" + RUN apt-get update \ && install-php-extensions xdebug \ && (type -p wget >/dev/null || (apt update && apt install wget -y)) \ @@ -75,6 +78,10 @@ RUN apt-get update \ && unzip /tmp/JetBrainsMono.zip -d /usr/share/fonts/nerd-fonts/JetBrainsMono \ && rm /tmp/JetBrainsMono.zip \ && fc-cache -fv \ + && eval "$(fnm env --use-on-cd --shell bash)" \ + && mkdir -p -m 777 /pnpm \ + && pnpm install -g playwright \ + && pnpx playwright install --with-deps \ && apt-get -y autoremove \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/README-ALPINE.md b/README-ALPINE.md index f23e40c..f92e9ac 100644 --- a/README-ALPINE.md +++ b/README-ALPINE.md @@ -60,6 +60,7 @@ Both Alpine and Bookworm variants provide the same functionality: ### Development Features (in -dev variants) - ✅ Xdebug PHP extension +- ✅ Playwright for browser automation and testing - ✅ GitHub CLI (`gh`) - ✅ Developer tools (htop, nano, starship prompt) - ✅ Zsh with Oh My Zsh and plugins diff --git a/alpine.Dockerfile b/alpine.Dockerfile index 7f6d4c9..4fae281 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -37,6 +37,9 @@ RUN apk add --no-cache nodejs npm jpegoptim optipng pngquant gifsicle libavif li FROM base AS dev +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" + RUN install-php-extensions xdebug \ && apk add --no-cache wget tar gzip \ && ARCH=$(uname -m) \ @@ -65,6 +68,9 @@ RUN install-php-extensions xdebug \ && unzip /tmp/JetBrainsMono.zip -d /usr/share/fonts/nerd-fonts/JetBrainsMono \ && rm /tmp/JetBrainsMono.zip \ && fc-cache -fv \ + && mkdir -p -m 777 /pnpm \ + && pnpm install -g playwright \ + && pnpx playwright install --with-deps \ && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* # Switch to the deploy user to install Oh My Zsh and plugins diff --git a/docker-bake.hcl b/docker-bake.hcl index dcde7a4..386df5e 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -90,7 +90,7 @@ target "default" { } labels = { - "org.opencontainers.image.description" = variant == "dev" ? "FrankenPHP Docker images (${os}) with supervisor, fnm(node version manager), pnpm, sqlsrv, Xdebug, and a few other goodies." : "FrankenPHP Docker images (${os}) with supervisor, fnm(node version manager), pnpm, sqlsrv, and a few other goodies." + "org.opencontainers.image.description" = variant == "dev" ? "FrankenPHP Docker images (${os}) with supervisor, fnm(node version manager), pnpm, Playwright, sqlsrv, Xdebug, and a few other goodies." : "FrankenPHP Docker images (${os}) with supervisor, fnm(node version manager), pnpm, sqlsrv, and a few other goodies." "org.opencontainers.image.created" = "${timestamp()}" "org.opencontainers.image.version" = variant == "dev" ? "${clean_tag(php_version)}-${os}-dev" : "${clean_tag(php_version)}-${os}" "org.opencontainers.image.revision" = SHA diff --git a/test.php b/test.php index 735dcf8..ce40075 100644 --- a/test.php +++ b/test.php @@ -17,7 +17,7 @@ const PRODUCTION_ONLY_BINARIES = []; -const DEV_ONLY_BINARIES = ['gh', 'htop', 'nano']; +const DEV_ONLY_BINARIES = ['gh', 'htop', 'nano', 'playwright', 'pnpx']; const DEV_BINARIES = [ ...PRODUCTION_BINARIES,