Skip to main content

Docker Compose on VPS

If you require full control over the infrastructure, you can deploy the AI Agent Starter Kit on a new VPS using the provided docker-compose.prod.yml. For Laravel, the setup uses a multi-stage Dockerfile based on the php-fpm-alpine image, optimized for production usage.


Migrator Service

The stack includes a dedicated Migrator Service.

The migrator service is responsible for running database migrations and is designed to execute only once per deployment.
This behavior is already configured in the production Docker Compose file.

Note:
During execution, the migrator enables Laravel’s maintenance mode while applying database migrations.

The maintenance page is synchronized across all services (such as php-fpm and worker) using the database cache. This behavior is controlled by the following environment variables:

  • APP_MAINTENANCE_DRIVER
  • APP_MAINTENANCE_STORE

This is required only on the first deployment or whenever new database migrations are added.

To up all Docker containers with the migrator included use:

docker compose --profile migrate up -d

If you don't need to migrate DB, then please use standard: docker compose up -d without profile flag.