Build Configuration
SKE builds a container image for each deployment from a Dockerfile the runtime generates. You can add your own build steps with ske/Dockerfile, and run commands after each deploy with deploy hooks.
Default build
Section titled “Default build”ske deploy gets the generated Dockerfile from the API on each deploy; nothing is written to your repository. For Laravel, the generated Dockerfile:
- Builds on a
serversideup/phpFPM Alpine image of the environment’s PHP version - Includes the SKE adapter binary for request handling
- Runs
composer install --no-devand an optimized autoloader dump, with no scripts - Copies your application code and removes
.env
Private Composer packages authenticate with a COMPOSER_AUTH build secret: set it in your shell before ske deploy.
The generated Dockerfile doesn’t build frontend assets. Build them before ske deploy (for example npm run build), or add the steps to ske/Dockerfile.
Your own build steps
Section titled “Your own build steps”To add steps such as system packages or PHP extensions, create ske/Dockerfile:
ske dockerfileThis writes a starter. ske deploy joins your file into the generated Dockerfile after its base stage (ske-base) and before your code is copied in:
FROM ske-base
RUN install-php-extensions imagickRUN apk add --no-cache ffmpegStart from ske-base to keep everything SKE sets up. Don’t add a # syntax= line, and don’t name stages starting with ske; ske deploy refuses those before it starts. A build error in your file is reported with its line in ske/Dockerfile.
Deploy hooks
Section titled “Deploy hooks”Deploy hooks run on each deploy, in order, on the new version of the environment’s CLI function, while queues and web traffic stay on the old release. Only when they all succeed does traffic switch to the new version. A failing hook fails the deploy and leaves the old release live. Set them under the environment’s Settings, Deploy hooks, for example:
php artisan migrate --forcePHP version and architecture
Section titled “PHP version and architecture”Set the PHP version (8.2 to 8.5, default 8.4) and the CPU architecture (x86_64 or arm64) under the environment’s Settings, Runtime & build. The image is built for that architecture.
Build context
Section titled “Build context”When the project has no .dockerignore, ske deploy writes one with the runtime’s defaults. For Laravel it leaves out:
.git,.envand.env.*(except.env.*.encryptedfiles, which ship)node_modules,vendor(reinstalled during build) andtestsstorage/logs,storage/pail,storage/frameworkandbootstrap/cache/*.phppublic/hot,docs,packages/*/testsand SQLite database files
An existing .dockerignore is yours and is never changed.
Asset uploads
Section titled “Asset uploads”During deployment, SKE copies the public/ directory out of the built image and uploads its files to cloud storage for CDN delivery. Files that haven’t changed since the last deploy are copied, not uploaded again. This happens automatically — no configuration needed.