Create Magento App
Create ScandiPWA AppScandiPWA DocsGitHub
v1
v1
  • Create Magento App
  • Getting started
    • Getting Started
    • Prerequisites
      • Linux requirements
      • MacOS requirements
        • Apple Silicon
      • Windows requirements
    • Available commands
      • Start the application
      • Stop the application
      • Check application status
      • Enter application CLI
      • Explore application logs
      • Execute commands in Docker containers
      • Link a theme
      • Import database dump
      • ⚠️ Uninstall a project
    • Folder structure
    • Updating to New Releases
      • Testing Alpha Releases
    • Configuration File
    • Supported Magento versions
    • How does it work?
    • Limitations
  • Usage guide
    • Using console commands
    • Accessing Docker containers
    • Linking a Scandi Theme
    • Enabling XDebug
    • Enabling SSL
    • Configuring PHP
    • Use custom domain
    • Access on the local network
    • Importing database
      • Importing remote database
    • Using Enterprise Edition
    • Converting legacy Docker setup to CMA
    • Improve Performance
  • Scripts Extensions
    • PHP Extensions
      • ionCube Extension
  • Troubleshooting
    • Common Issues
    • CMA Debugging
    • Uninstall CMA
Powered by GitBook
On this page
  • Project Configuration File
  • Magento
  • Services
  • Domain
  • SSL
  • Prefix
  • System Configuration FIle
  • Use Non-Overlapping Ports
  • Analytics
  1. Getting started

Configuration File

Project Configuration File

Since magento-scripts 1.2.0

default cma.js
/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: {
        first_name: 'Scandiweb',
        last_name: 'Developer',
        email: 'developer@scandipwa.com',
        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

Magento configuration is located in magento field and contains the following fields:

  • first_name - Admin first name

  • last_name - Admin last name

  • email - Admin email

  • user - Admin user name

  • password Admin password

  • adminuri - Admin panel URL

  • 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 using 7.4.27.

  • 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.

/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: { ... },
    configuration: {
        php: {
            // lets change the default php version from 7.4.13 to 7.4.20
            version: '7.4.20',
            // and add some extensions
            extensions: {
                fileinfo: {},
                xdebug: {
                    version: '3.0.4'
                }
            }
        }
    }
};

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 is 1.18.0

/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: { ... },
    configuration: {
        nginx: {
            // lets change nginx image version to 1.19
            version: '1.19.0',
            // and use custom nginx template
            configTemplate: './nginx.conf.template'
        }
    }
};

MySQL

MySQL configuration is located in the mysql field and contains the following fields:

  • version - Container version string. For MySQL default version is 8.0

/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: { ... },
    configuration: {
        mysql: {
            // lets change mysql image version to 8.0.25
            version: '8.0.25'
        }
    }
};

ElasticSearch

ElasticSearch configuration is located in the elasticsearch field and contains the following fields:

  • version - Container version string. For ElasticSearch default version is 7.6.2

/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: { ... },
    configuration: {
        elasticsearch: {
            // lets change elasticsearch image version to 7.13.1
            version: '7.13.1'
        }
    }
};

Redis

Redis configuration is located in the redis field and contains the following fields:

  • version - Container version string. For Redis default version is 6.0.10-alpine

/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: { ... },
    configuration: {
        redis: {
            // lets change redis image version to 6.2.4
            version: '6.2.4'
        }
    }
};

Composer

Composer configuration is located in the composer field and contains the following fields:

  • version - Composer version string.

/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: { ... },
    configuration: {
        composer: {
            // lets change composer version to 2.3.7
            version: '2.3.7'
        }
    }
};

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)

  • version - Varnish version string.

/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: { ... },
    configuration: {
        varnish: {
            // lets change composer version to 6.0
            version: '6.0'
        }
    }
};

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 is 1.18.0

/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: { ... },
    configuration: {
        sslTerminator: {
            // lets change nginx image version to 1.19
            version: '1.19.0',
            // and use custom ssl-terminator nginx template
            configTemplate: './ssl-terminator.conf.template'
        }
    }
};

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.

/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: { ... },
    host: 'scandipwa.local'
};

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.

/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: { ... },
    ssl: {
        enabled: true,
        ssl_certificate: './path/to/my/certificate',
        ssl_certificate_key: './path/to/my/certificate-key.pem'
    }
};

Prefix

Prefix configuration is a boolean located in the prefix field and by default, it is set to true .

/** @type {import('@scandipwa/magento-scripts').CMAConfiguration} */
module.exports = {
    magento: { ... },
    prefix: false
};

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:

$HOME/.cmarc
  {
    "useNonOverlappingPorts": false,
    "analytics": true
  }

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.

PreviousTesting Alpha ReleasesNextSupported Magento versions

Last updated 2 years ago

mode - Magento mode (description and list of available modes is located )

configTemplate - php.ini template file location. With this option, you can define your own php.ini file that will be used by PHP. (Original php-template.ini file can be found )

configTemplate - Nginx template file location string. With this option, you can define your own nginx.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 (Original nginx.template.conf file can be found )

Nginx image is pulled from .

MySQL image is pulled from .

ElasticSearch image is pulled from .

Redis image is pulled from .

configTemplate - varnish.vcl template file location. With this option, you can define your own varnish.vcl file that will be used by Varnish. (Original varnish.template.vcl file can be found )

Varnish image is pulled from .

configTemplate - SSL Terminator template file location string. With this option, you can define your own ssl-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 (Original ssl-terminator.template.conf file can be found )

Nginx image is pulled from .

Learn about adding a localhost domain to your application .

Learn about enabling SSL in your application .

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 ) Setting prefix to false is generally not recommended but might be necessary for legacy projects.

here
here
here
Docker Hub
Docker Hub
ElasticSearch Hub
Docker Hub
here
Docker Hub
here
Docker Hub
here
here
that