Skip to content

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.

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/php FPM Alpine image of the environment’s PHP version
  • Includes the SKE adapter binary for request handling
  • Runs composer install --no-dev and 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.

To add steps such as system packages or PHP extensions, create ske/Dockerfile:

Terminal window
ske dockerfile

This 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 imagick
RUN apk add --no-cache ffmpeg

Start 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 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 --force

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.

When the project has no .dockerignore, ske deploy writes one with the runtime’s defaults. For Laravel it leaves out:

  • .git, .env and .env.* (except .env.*.encrypted files, which ship)
  • node_modules, vendor (reinstalled during build) and tests
  • storage/logs, storage/pail, storage/framework and bootstrap/cache/*.php
  • public/hot, docs, packages/*/tests and SQLite database files

An existing .dockerignore is yours and is never changed.

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.