Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build frontend assets with Bun #90

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions FrankenPHP.Alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

###########################################

Expand Down
19 changes: 6 additions & 13 deletions FrankenPHP.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

###########################################

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 6 additions & 13 deletions RoadRunner.Alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

###########################################

Expand Down
19 changes: 6 additions & 13 deletions RoadRunner.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

###########################################

Expand Down
19 changes: 6 additions & 13 deletions Swoole.Alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

###########################################

Expand Down
19 changes: 6 additions & 13 deletions Swoole.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

###########################################

Expand Down
Loading