diff --git a/FrankenPHP.Alpine.Dockerfile b/FrankenPHP.Alpine.Dockerfile index 77da134..72bf535 100644 --- a/FrankenPHP.Alpine.Dockerfile +++ b/FrankenPHP.Alpine.Dockerfile @@ -6,31 +6,24 @@ ARG FRANKENPHP_VERSION=latest ARG COMPOSER_VERSION=latest ########################################### -# Build frontend assets with NPM +# Build frontend assets with Bun ########################################### -ARG NODE_VERSION=20-alpine +ARG BUN_VERSION="latest" -FROM node:${NODE_VERSION} AS build +FROM oven/bun:${BUN_VERSION} AS build ENV ROOT=/var/www/html WORKDIR ${ROOT} -RUN npm config set update-notifier false && npm set progress=false +COPY --link package.json bun.lockb* ./ -COPY --link package*.json ./ - -RUN if [ -f $ROOT/package-lock.json ]; \ - then \ - npm ci --loglevel=error --no-audit; \ - else \ - npm install --loglevel=error --no-audit; \ - fi +RUN bun install --frozen-lockfile COPY --link . . -RUN npm run build +RUN bun run build ########################################### diff --git a/FrankenPHP.Dockerfile b/FrankenPHP.Dockerfile index c1f4b01..b7b29e8 100644 --- a/FrankenPHP.Dockerfile +++ b/FrankenPHP.Dockerfile @@ -6,31 +6,24 @@ ARG FRANKENPHP_VERSION=latest ARG COMPOSER_VERSION=latest ########################################### -# Build frontend assets with NPM +# Build frontend assets with Bun ########################################### -ARG NODE_VERSION=20-alpine +ARG BUN_VERSION="latest" -FROM node:${NODE_VERSION} AS build +FROM oven/bun:${BUN_VERSION} AS build ENV ROOT=/var/www/html WORKDIR ${ROOT} -RUN npm config set update-notifier false && npm set progress=false +COPY --link package.json bun.lockb* ./ -COPY --link package*.json ./ - -RUN if [ -f $ROOT/package-lock.json ]; \ - then \ - npm ci --loglevel=error --no-audit; \ - else \ - npm install --loglevel=error --no-audit; \ - fi +RUN bun install --frozen-lockfile COPY --link . . -RUN npm run build +RUN bun run build ########################################### diff --git a/README.md b/README.md index 7b6bf3d..f3b60e5 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ Also, some useful Bash functions and aliases are added in `utilities.sh` that ma ## ToDo - [x] Add support for PHP 8.3 - [x] Add support for worker mode -- [ ] Build assets with Bun +- [x] Build assets with Bun - [ ] Create standalone and self-executable app - [x] Add support for Horizon - [x] Add support for RoadRunner diff --git a/RoadRunner.Alpine.Dockerfile b/RoadRunner.Alpine.Dockerfile index a1801ac..bc68127 100644 --- a/RoadRunner.Alpine.Dockerfile +++ b/RoadRunner.Alpine.Dockerfile @@ -4,31 +4,24 @@ ARG PHP_VERSION=8.3 ARG COMPOSER_VERSION=latest ########################################### -# Build frontend assets with NPM +# Build frontend assets with Bun ########################################### -ARG NODE_VERSION=20-alpine +ARG BUN_VERSION="latest" -FROM node:${NODE_VERSION} AS build +FROM oven/bun:${BUN_VERSION} AS build ENV ROOT=/var/www/html WORKDIR ${ROOT} -RUN npm config set update-notifier false && npm set progress=false +COPY --link package.json bun.lockb* ./ -COPY --link package*.json ./ - -RUN if [ -f $ROOT/package-lock.json ]; \ - then \ - npm ci --loglevel=error --no-audit; \ - else \ - npm install --loglevel=error --no-audit; \ - fi +RUN bun install --frozen-lockfile COPY --link . . -RUN npm run build +RUN bun run build ########################################### diff --git a/RoadRunner.Dockerfile b/RoadRunner.Dockerfile index a492dd0..5b0269b 100644 --- a/RoadRunner.Dockerfile +++ b/RoadRunner.Dockerfile @@ -4,31 +4,24 @@ ARG PHP_VERSION=8.3 ARG COMPOSER_VERSION=latest ########################################### -# Build frontend assets with NPM +# Build frontend assets with Bun ########################################### -ARG NODE_VERSION=20-alpine +ARG BUN_VERSION="latest" -FROM node:${NODE_VERSION} AS build +FROM oven/bun:${BUN_VERSION} AS build ENV ROOT=/var/www/html WORKDIR ${ROOT} -RUN npm config set update-notifier false && npm set progress=false +COPY --link package.json bun.lockb* ./ -COPY --link package*.json ./ - -RUN if [ -f $ROOT/package-lock.json ]; \ - then \ - npm ci --loglevel=error --no-audit; \ - else \ - npm install --loglevel=error --no-audit; \ - fi +RUN bun install --frozen-lockfile COPY --link . . -RUN npm run build +RUN bun run build ########################################### diff --git a/Swoole.Alpine.Dockerfile b/Swoole.Alpine.Dockerfile index 9ff15f1..768f228 100644 --- a/Swoole.Alpine.Dockerfile +++ b/Swoole.Alpine.Dockerfile @@ -4,31 +4,24 @@ ARG PHP_VERSION=8.3 ARG COMPOSER_VERSION=latest ########################################### -# Build frontend assets with NPM +# Build frontend assets with Bun ########################################### -ARG NODE_VERSION=20-alpine +ARG BUN_VERSION="latest" -FROM node:${NODE_VERSION} AS build +FROM oven/bun:${BUN_VERSION} AS build ENV ROOT=/var/www/html WORKDIR ${ROOT} -RUN npm config set update-notifier false && npm set progress=false +COPY --link package.json bun.lockb* ./ -COPY --link package*.json ./ - -RUN if [ -f $ROOT/package-lock.json ]; \ - then \ - npm ci --loglevel=error --no-audit; \ - else \ - npm install --loglevel=error --no-audit; \ - fi +RUN bun install --frozen-lockfile COPY --link . . -RUN npm run build +RUN bun run build ########################################### diff --git a/Swoole.Dockerfile b/Swoole.Dockerfile index 0534acb..579f79f 100644 --- a/Swoole.Dockerfile +++ b/Swoole.Dockerfile @@ -4,31 +4,24 @@ ARG PHP_VERSION=8.3 ARG COMPOSER_VERSION=latest ########################################### -# Build frontend assets with NPM +# Build frontend assets with Bun ########################################### -ARG NODE_VERSION=20-alpine +ARG BUN_VERSION="latest" -FROM node:${NODE_VERSION} AS build +FROM oven/bun:${BUN_VERSION} AS build ENV ROOT=/var/www/html WORKDIR ${ROOT} -RUN npm config set update-notifier false && npm set progress=false +COPY --link package.json bun.lockb* ./ -COPY --link package*.json ./ - -RUN if [ -f $ROOT/package-lock.json ]; \ - then \ - npm ci --loglevel=error --no-audit; \ - else \ - npm install --loglevel=error --no-audit; \ - fi +RUN bun install --frozen-lockfile COPY --link . . -RUN npm run build +RUN bun run build ###########################################