Build Configuration
SKE builds a container image for each deployment. The Laravel runtime generates a default Dockerfile, but you can customize the build with your own Dockerfile and build hooks.
Default build
Section titled “Default build”When you deploy without a custom Dockerfile, SKE generates one based on your runtime. For Laravel, the generated Dockerfile:
- Uses a PHP base image matching your configured version
- Installs required PHP extensions
- Runs
composer install --no-dev --optimize-autoloader - Copies your application code
- Includes the SKE adapter binary for request handling
The generated Dockerfile is placed in ske/Dockerfile relative to your project root.
Custom Dockerfile
Section titled “Custom Dockerfile”To use a custom Dockerfile, set the dockerfile key in ske.yml:
name: my-appenvironments: production: dockerfile: docker/production.DockerfileOr set it at the project level to apply to all environments:
name: my-appdockerfile: docker/Dockerfileenvironments: production: {} staging: {}Per-environment dockerfile overrides the project-level setting.
Dockerfile resolution order
Section titled “Dockerfile resolution order”- Per-environment
dockerfileinske.yml - Project-level
dockerfileinske.yml - Default:
ske/Dockerfile(auto-generated by the runtime)
Build hooks
Section titled “Build hooks”Build hooks let you run custom commands during the container build. Define them in ske.yml:
name: my-appenvironments: production: build_hooks: - npm ci - npm run build - php artisan route:cache - php artisan config:cache - php artisan view:cache - php artisan event:cacheBuild hooks run inside the container during the image build, after composer install and before the final image layer. They’re useful for:
- Compiling frontend assets (
npm run build,vite build) - Caching Laravel configuration files
- Running any pre-deployment preparation
Deploy hooks
Section titled “Deploy hooks”Deploy hooks run after the container is deployed and active:
name: my-appenvironments: production: deploy_hooks: - php artisan migrate --forceDeploy hooks execute as remote commands against the deployed environment. Use them for database migrations or other post-deploy tasks.
PHP version and extensions
Section titled “PHP version and extensions”The PHP version and extensions are determined by the Laravel runtime based on your composer.json requirements. SKE reads your require.php constraint and selects the appropriate base image.
To pin a specific PHP version, set it in composer.json:
{ "require": { "php": "^8.3" }}Build context
Section titled “Build context”The build context includes your entire project directory, excluding:
.git/.envvendor/(reinstalled during build)node_modules/(reinstalled if build hooks use npm)tests/storage/(ephemeral on serverless — use cloud storage instead)
Asset uploads
Section titled “Asset uploads”During deployment, SKE scans your public/ directory and uploads static assets (CSS, JS, images, fonts) to cloud storage for CDN delivery. This happens automatically — no configuration needed.
The artifact size limit is 500 MB.