Configuration File
Project Configuration File
Since magento-scripts 1.2.0
The configuration file is created when you start the project cma.js
, it's a tool that allows you to be in control of important parts of the project without headaches.
Magento
Magento configuration is located in magento
field and contains the following fields:
first_name
- Admin first namelast_name
- Admin last nameemail
- Admin emailuser
- Admin user namepassword
Admin passwordadminuri
- Admin panel URLmode
- Magento mode (description and list of available modes is located here)edition
- Magento edition. Allowed values:community
,enterprise
.
Services
In the field configuration
we can configure PHP, Composer and Docker services.
PHP configuration
PHP configuration is located in the php
field and contains the following fields:
version
- PHP version, by default it is using7.4.27
.configTemplate
-php.ini
template file location. With this option, you can define your ownphp.ini
file that will be used by PHP. (Originalphp-template.ini
file can be found here)extensions
- Map of extensions that will be used for the project. By default, it contains the following extensions that are required by Magento: gd, intl, zlib, openssl, sockets, SimpleXML, xdebug. You can add an extension that will be required by some Composer package, CMA will automatically install it with the correct version.disabledExtensions
- Array of strings as extension names. If for some reason you need to manually disable an extension in your setup, you can put its name in this option. Be careful as this could potentially break your setup.
Docker services configuration
Nginx
Nginx configuration is located in the nginx
field and contains the following fields:
version
- Container version string. For Nginx default version is1.18.0
configTemplate
- Nginx template file location string. With this option, you can define your ownnginx.template.conf
- File that will be copied inside the$CMA_CACHE/nginx/conf.d/
folder which is mounted in Nginx container to/etc/nginx/conf.d/
folder. string (Originalnginx.template.conf
file can be found here)
Nginx image is pulled from Docker Hub.
MySQL
MySQL configuration is located in the mysql
field and contains the following fields:
version
- Container version string. For MySQL default version is8.0
MySQL image is pulled from Docker Hub.
ElasticSearch
ElasticSearch configuration is located in the elasticsearch
field and contains the following fields:
version
- Container version string. For ElasticSearch default version is7.6.2
ElasticSearch image is pulled from ElasticSearch Hub.
Redis
Redis configuration is located in the redis
field and contains the following fields:
version
- Container version string. For Redis default version is6.0.10-alpine
Redis image is pulled from Docker Hub.
Composer
Composer configuration is located in the composer
field and contains the following fields:
version
- Composer version string.
Varnish
Since magento-scripts 1.15.0
Varnish configuration is located in the varnish
field and contains the following fields:
enabled
- A boolean option to manually enable or disable Varnish in the setup. (Default:false
)configTemplate
-varnish.vcl
template file location. With this option, you can define your ownvarnish.vcl
file that will be used by Varnish. (Originalvarnish.template.vcl
file can be found here)version
- Varnish version string.
Varnish image is pulled from Docker Hub.
SSL Terminator (Nginx)
Since magento-scripts 1.15.0
SSL Terminator is an Nginx instance, it's configuration is located in sslTerminator
field and contains the following fields:
version
- Container version string. For Nginx default version is1.18.0
configTemplate
- SSL Terminator template file location string. With this option, you can define your ownssl-terminator.template.conf
- File that will be copied inside the$CMA_CACHE/ssl-terminator/conf.d/
folder which is mounted in Nginx container to/etc/nginx/conf.d/
folder. string (Originalssl-terminator.template.conf
file can be found here)
Nginx image is pulled from Docker Hub.
Domain
The host configuration is a string located in host
field and by default, it is set to localhost
.
You can put your own host domain that will be set to nginx config as server_name
and set Magento secure and unsecure base_url values.
Learn about adding a localhost domain to your application here.
SSL
SSL configuration is located in the ssl
field and contains the following values:
enabled
- Enables or disables SSL in the application. boolean (false
by default)ssl_certificate
- SSL certificate file location string. You can put there your SSL certificate file location relative to the project root folder or use absolute value.ssl_certificate_key
- SSL certificate key file location string. You can put there your SSL certificate file location relatively to the project root folder or use absolute value.
Learn about enabling SSL in your application here.
Prefix
Prefix configuration is a boolean located in the prefix
field and by default, it is set to true
.
But what prefixes are used for?
Prefix is a unique identifier that will be appended to docker container and volume names to prevent possible interference between folders with similar names. (Interference between folders look like that)
Setting prefix
to false
is generally not recommended but might be necessary for legacy projects.
System Configuration FIle
Since magento-scripts 1.5.1
This configuration file is located in your home directory and should have a name .cmarc
.
As it is not created automatically, you will need to do it manually.
The default configuration file looks like this:
This configuration file contains the following configuration options:
Use Non-Overlapping Ports
Recommended to enable this option if you are working with many CMA projects
Use non-overlapping ports is a feature that will tell CMA when choosing available ports on the system to also ignore ports that are already used by other CMA instances, even if they are stopped. That way it will ensure that your projects will not get new ports every time you switch between them.
To enable this feature, set useNonOverlappingPorts
field in the system configuration file to true
.
Analytics
Analytics help us to collect data about errors or possible slow-downs and help us to identify areas that should be fixed or improved!
Of course, you have an option to opt-out of analytic data collection. To do that set analytics
field in the system configuration file to false
and CMA will not collect analytic data from your system.
Last updated