Comment on page
Configuration File
default cma.js
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: {
first_name: 'Scandiweb',
last_name: 'Developer',
email: '[email protected]',
user: 'admin',
password: 'scandipwa123',
adminuri: 'admin',
mode: 'developer',
edition: 'community'
},
configuration: {}
};
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 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 URLedition
- Magento edition. Allowed values:community
,enterprise
.
In the
configuration
field we can configure PHP, Composer and Docker services.PHP configuration is located in the
php
field and contains the following fields: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)debugTemplate
-xdebug.ini
template file location. With this option you can tweak the XDebug configuration used in together withdebugImage
. (Originalphp-debug.template.ini
file can be found here)fpmConfigTemplate
-php-fpm.conf
template file location. With this option you can tweak the PHP-FPM configuration used by PHP-FPM. (Originalphp-fpm.template.conf
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. You can add an extension that will be required by some Composer package, CMA will automatically install it with the correct version. Learn more about installing extensions in our guide on Configuring PHP!
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
configuration: {
php: {
// and add some extensions
extensions: {
fileinfo: {}
}
}
}
};
Nginx configuration is located in the
nginx
field and contains the following fields:image
- Container image string. For Nginx default version isnginx:1.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)
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
configuration: {
nginx: {
// lets change nginx image to 1.19.0
image: 'nginx:1.19.0',
// and use custom nginx template
configTemplate: './nginx.conf.template'
}
}
};
MariaDB configuration is located in the
mariadb
field and contains the following fields:image
- Container image string.
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
configuration: {
mariadb: {
// lets change mariadb image version to 10.4
version: '10.4'
}
}
};
ElasticSearch configuration is located in the
elasticsearch
field and contains the following fields:image
- Container image string.
Magento 2.2.10 - 2.3.4 are using our custom ElasticSearch image that works on amd64 and arm64 architectures.
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
configuration: {
elasticsearch: {
// lets change elasticsearch image version to 7.13.1
image: 'elasticsearch:7.13.1'
}
}
};
Redis configuration is located in the
redis
field and contains the following fields:image
- Container image string. For Redis default version is6.0.10-alpine
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
configuration: {
redis: {
// lets change redis image version to 6.2.4
image: 'redis:6.2.4'
}
}
};
Composer configuration is located in the
composer
field and contains the following fields:version
- Composer version string.plugins
- Map of Composer global plugins with a configuration that will be added to project image.plugins[name].enabled
- aboolean
which determines if the plugin should be enabled. For example, if you are using an older Magento version with Composer 1 Prestissimo plugin is enabled by default to speed-up installation and you can disable it!plugins[name].options
- astring
with additional options forcomposer global require <name> <options>
command.
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
configuration: {
composer: {
// lets change composer version to 2.3.7
version: '2.3.7',
plugins: {
'hirak/prestissimo': {
enabled: true
}
}
}
}
};
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)image
- Varnish image string.healthCheck
- A boolean option to manually enable or disable Varnish HealthCheck in the setup. (Default:false
)
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
configuration: {
varnish: {
// lets change composer version to 6.0
image: 'varnish:6.0'
}
}
};
SSL Terminator is an Nginx instance, its configuration is located in
sslTerminator
field and contains the following fields:image
- Container image string.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)
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
configuration: {
sslTerminator: {
// lets change nginx image version to 1.19
image: 'nginx:1.19.0',
// and use custom ssl-terminator nginx template
configTemplate: './ssl-terminator.conf.template'
}
}
};
Available only on Linux. WSL is not supported.
NewRelic is a monitoring service for applications and uses the following configurations fileds:
enabled
- Boolean indicating if NewRelic is used in the application or not. Default isfalse
.licenseKey
- License key string. Located in API Keys section on NewRelic.
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
configuration: {
newRelic: {
enabled: true,
licenseKey: '<LICENSE_KEY>'
}
}
};
Available in
magento-scripts
~2.0.x and ~2.1.xThe 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./** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
host: 'scandipwa.local'
};
Since
magento-scripts
2.2.x!storeDomains
allows to set different domains for Magento stores.Use
store code
as key
and domain as a value
./** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
storeDomains: {
admin: 'scandipwa.local'
}
};
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)external_provider
- Allows to use external SSL provider 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.
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
ssl: {
enabled: true,
external_provider: false,
ssl_certificate: './path/to/my/certificate',
ssl_certificate_key: './path/to/my/certificate-key.pem'
}
};
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./** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
magento: { ... },
prefix: false
};
Last modified 21d ago