CI4 Docker Premium Starter Kit

Documentation

Introduction

CI4 Docker Premium Starter Kit

The CI4 Docker Premium Starter Kit is a professional base system for developing and deploying CodeIgniter 4 applications, fully containerized and production-ready. Clone, configure, and run in under 10 minutes.

The kit solves the most common problems when starting a serious project:

  • Docker infrastructure ready out of the box
  • Functional CI4 environment with Shield, Queue and Redis pre-configured
  • VIAVI Operations Panel at /viavi/ for health, queues and kit controls
  • Foundation for real CI/CD pipelines
  • Production-ready from day one
Component Version Role
CodeIgniter 4 ^4.7 MVC framework, Shield auth, Queue
PHP 8.2 (FPM) Runtime, FastCGI
Nginx 1.28-alpine Reverse proxy, static files
MySQL 8.4 Primary database
Redis 7-alpine Cache, sessions, queue backend
PHPStan ^1.11 Static analysis level 6, zero errors
PHPUnit ^10.5 Unit, bootstrap, session and DB testing
Sentry SDK ^4.10 Error capture in production

Prerequisites

PHP and Composer are not required on the host machine — everything runs inside containers.

  • Docker Desktop 4.x or Docker Engine 24.x with Compose v2
  • GNU Make
  • Git 2.x

Implementation guide

1. Unzip the kit

Unzip the file into your empty project folder.

2. Configure the environment

$ cp .env.example .env
$ # Edit .env with your local values

3. Start the environment

$ make setup
# Runs: build + up + migrate + seed + healthcheck

4. Verify the status

$ curl http://localhost:8080/health
// Expected response
{
  "status": "ok",
  "database": { "status": "ok" },
  "redis": { "status": "ok" }
}

5. Quality gates

$ make stan # PHPStan level 6 — no errors
$ make rector # Rector dry-run — no changes
$ make test # PHPUnit — all suites must pass

Configuration

KIT_STAGE

Controls what is served at /. Toggle from the operations panel or via Make:

Valor Behavior
setup VIAVI onboarding screen (default)
building VIAVI onboarding screen while you build
launched Serves your application at /
$ make launch # KIT_STAGE=launched
$ make stage-building # KIT_STAGE=building
$ make stage-setup # KIT_STAGE=setup

Default credentials

Change these credentials immediately after the first login.
Email admin@local.test
Password Password123!

Usage

VIAVI Operations Panel

The kit ships with a built-in operations panel at /viavi/, always available regardless of your application's state.

URL Description
/viavi/ Main panel — health, queues, kit controls
/viavi-dashboard Shortcut to the operations panel
/viavi/profile Update email and password
/viavi/commands Makefile command reference
/health Public JSON healthcheck for orchestrators

Starting your application

  1. Edit app/Views/home.php with your application home screen.
  2. Define your routes in app/Config/Routes.php.
  3. Edit app/Controllers/Home.php with your root controller logic.
  4. Launch your app:
$ make launch

Routes reserved by the kit — do not overwrite: /viavi/*, /viavi-dashboard, /health, /login, /post-login, /set-organization/*

Available commands

$ make setup # Build, up, migrate, seed, healthcheck
$ make test # PHPUnit — all suites
$ make stan # PHPStan level 6
$ make rector # Rector dry-run
$ make migrate # Run pending migrations
$ make seed # Run seeders
$ make launch # KIT_STAGE=launched
$ make deploy # Deploy (see scripts/deploy.sh)

Deployment

The kit includes deployment guides for three platforms. Select the one that best fits your project.

Railway

Ultimate Tier required

PaaS platform with native MySQL 8 and Redis 7 plugins. Environment variables are injected directly — the .env file is not used in production.

$ railway login
$ railway link
$ railway run php spark migrate --all

KIT_STAGE must be set in Railway's Variables panel, not in .env.

Render

Ultimate Tier required

Render does not offer MySQL natively — use PlanetScale or Railway MySQL as an external provider. Redis available as a native service.

Render free tier sleeps after 15 minutes of inactivity — use a paid plan for production.

VPS (Ubuntu 24.04)

Ultimate Tier required

Full control. The .env file persists on disk, so the KIT_STAGE switch from the VIAVI panel works correctly in production.

$ ./scripts/deploy.sh v1.0.0
# backup → pull → migrate → healthcheck

FAQ

Basic knowledge is enough. The kit includes clear documentation and scripts that do the heavy lifting. With make setup your environment is running in minutes.

Yes. Any system with Docker Desktop installed can run this kit without modifications.

Yes, with exceptions. The kit reserved routes (/viavi/*, /health, /login) must not be overwritten. Everything else is yours.

No. The panel requires authentication. Only users with valid credentials can access /viavi/.

Yes. The license allows use in personal and client projects. One license per project.

You'll receive email notifications and can download the new version from your license panel on VIAVI.