⚠️ For a better experience, consider using Custom Docker Compose released in version 4.6.0.
Starting from EasyEngine v4.2.0, we have given the feature to update the docker-compose stack of an EasyEngine site or that of global service.
This means now it’s possible to change the way the docker container works on a site. One popular use case would be to change the docker images that EasyEngine uses for a site. By changing the docker image of let’s say a PHP container, you can do things like adding your own site-specific PHP extensions to EasyEngine, or you can even add other software/runtime like NodeJS etc…
You can change the stack of a site, or you can even change the global service stack.
How it works
The way it works is quite simple, you just have to define a docker-compose-custom.yml
file in your site/service root, and EasyEngine will use that file along with the default docker-compose.yml
like:
docker-compose -f docker-compose.yml docker-compose-custom.yml <command>
How to Change Stack of a Site
To change the stack of a site, go to site root i.e. /opt/easyengine/sites/example.com
and create a file named docker-compose-custom.yml
, and add your changes to it. Here is an example:
version: '3.5'
services:
php:
image: php:fpm-alpine
environment:
- CUSTOM_VAR=value
volumes:
- "./images:/var/www/htdocs/app/images"
Once you’ve done those changes, you can run the below command to apply your changes:
ee site enable --force
How to Change the Service Stack
You can even change the global service stack to do things like using a newer version of DB/Redis then shipped by EasyEngine or use MySQL instead of MariaDB etc…
Go to /opt/easyengine/services/
and create a file named docker-compose-custom.yml
, and add your changes to it. Here is an example:
version: '3.5'
services:
db:
image: mysql:latest
environment:
- CUSTOM_VAR=value
volumes:
- "./scripts:/scripts"
Once you’ve done those changes, you can run the below command to apply your changes:
ee site enable --force
Limitations
Currently, the only limitation is that you can only modify the existing services defined in default docker-compose.yml
, you cannot add a new service in it, i.e. you cannot add a node service to run alongside your PHP container. This support will be added in near future.