PHPackages                             boralp/laravel-vite-apple-container - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. boralp/laravel-vite-apple-container

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

boralp/laravel-vite-apple-container
===================================

Build Laravel Vite assets inside a hardened Apple Container.

v0.2.1(2mo ago)03MITPHPPHP ^8.2CI passing

Since May 4Pushed 2mo agoCompare

[ Source](https://github.com/boralp/laravel-vite-apple-container)[ Packagist](https://packagist.org/packages/boralp/laravel-vite-apple-container)[ Docs](https://github.com/boralp/laravel-vite-apple-container)[ RSS](/packages/boralp-laravel-vite-apple-container/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

Laravel Vite Apple Container
============================

[](#laravel-vite-apple-container)

Build Laravel Vite frontend assets inside an isolated Apple Container.

This package is designed for macOS users who use [`github.com/apple/container`](https://github.com/apple/container). It runs `npm ci` and `npm run build` in a hardened container with restricted filesystem access, disabled network access by default, and npm lifecycle scripts disabled by default.

The primary interface is a Laravel Artisan command:

```
php artisan lvac:build
```

A Composer binary wrapper is also provided:

```
./vendor/bin/lvac
```

The wrapper forwards arguments to the Artisan command.

Installation
------------

[](#installation)

Install via Composer:

```
composer require boralp/laravel-vite-apple-container --dev
```

If you need this package during production deployment builds, install it without `--dev`:

```
composer require boralp/laravel-vite-apple-container
```

Laravel package discovery will register the Artisan command automatically.

Quick Start
-----------

[](#quick-start)

From your Laravel project root, run the first build with network access so `npm ci` can download dependencies:

```
php artisan lvac:build --allow-network
```

Or use the Composer binary wrapper:

```
./vendor/bin/lvac --allow-network
```

Your compiled CSS and JavaScript assets will be written to:

```
public/build/

```

By default, the project source is mounted read-only. Only `public/build` is writable on the host.

After dependencies have been installed once, subsequent builds can usually run without network access:

```
php artisan lvac:build --build-only
```

Requirements
------------

[](#requirements)

- macOS with Apple Container installed
- Laravel 12.x or Laravel 13.x
- Laravel project with:
    - `artisan`
    - `package.json`
    - `package-lock.json`
- Apple Container system started:

```
container system start
```

Configuration
-------------

[](#configuration)

The package ships with a Laravel config file.

Publish it with:

```
php artisan vendor:publish --tag=lvac-config
```

This creates:

```
config/lvac.php

```

Available environment variables:

```
CONTAINER_CLI=container
LVAC_NODE_IMAGE=docker.io/library/node:24-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f
LVAC_MEMORY=2g
LVAC_CPUS=2
```

Default config:

```
