Environment Specific Configuration
Overview
Elastic Path Commerce supports defining different application configuration values for each deployed environment. Configuration is either stored in the Commerce database or provided via configuration files.
Configuration values stored in the Commerce database can be defined using Import/Export XML files and include:
Files based configuration includes:
Defining Environment Configurations
Review the environment directories and the configuration files.
Environment Directories
The extensions/database/ext-data/src/main/resources/environments
directory contains application configuration directories for each of your deployed environments, e.g. ci
, qa
, stage-author
, stage-live
, prod-author
and prod-live
. These are called environment directories.
Default Environment Directory
The environments/default
directory contains files that are used in all environments, unless they are overwritten by files with the same name in a specific environment directory.
Data Population Configuration Files
The following files in the root of an environment directory are used to provide environment-specific configuration to the Data Population Tool.
File | Purpose | Owned By |
---|---|---|
data-population-properties | Defines the data to be processed by the Data Population Tool for the current environment. | Dev team |
filtering.properties | Supplies property overrides for non-secret placeholders defined in Liquibase and Import/Export files. | Dev team |
secure-filtering.properties | Supplies property overrides for secret placeholders defined in Liquibase and Import/Export files. | Dev team (non-prod) / Ops team (prod) |
Application Configuration Files
The files/conf/
subdirectory in an environment folder contains application configuration files. The files are accessible at runtime in the /ep/conf/
directory.
Development teams are free to add any required files or directories to files/conf/
.
Managing Secrets
As described above, most configuration values are stored in the ep-commerce
source code repo. However, it is generally considered bad practice to store sensitive values such as credentials, API keys, or certificate files in an unencrypted source code repository.
For that reason, it is recommended that sensitive production values be stored separately, and retrieved by the Docker containers at startup.
The recommended best practices are:
- Non-sensitive values for all environments are stored in the
ep-commerce
source code repo within theextensions/database/ext-data/src/main/resources/environments
directory. - Sensitive values for non-production environments are stored in the
ep-commerce
source code repo within theextensions/database/ext-data/src/main/resources/environments
directory. - Sensitive values for production environments are stored in an encrypted Git repository with the following file structure:
prod-author
files
conf
secure
author-certificate-1.p12
author-certificate-2.p12
secure-filtering-properties
prod-live
files
conf
secure
live-certificate-1.p12
live-certificate-2.p12
secure-filtering-properties
For information about how this is supported in CloudOps for Kubernetes, see Injecting Commerce Configuration at Runtime.