Production mode
Production mode simulates your Commerce application in production so that you can verify configured services.
Production mode is the default configuration setting for launching the Docker environment with read-only filesystem permissions.
Prerequisites:
Complete the installation steps.
To launch the Docker environment in production mode:
In your local environment, start the Docker configuration generator. You can use the service configuration options, such as
--php
, to specify a version.Copied to your clipboard./vendor/bin/ece-docker build:composeOptional: If you have a custom PHP configuration file, copy the default configuration DIST file to your custom configuration file and make any necessary changes.
Copied to your clipboardcp .docker/config.php.dist .docker/config.phpBuild files to containers and run in the background.
Copied to your clipboarddocker compose up -dInstall Adobe Commerce in your Docker environment.
Build Adobe Commerce in the Docker container.
Copied to your clipboarddocker compose run --rm build cloud-buildDeploy Adobe Commerce in the Docker container.
Copied to your clipboarddocker compose run --rm deploy cloud-deployRun post-deploy hooks.
Copied to your clipboarddocker compose run --rm deploy cloud-post-deploy
Configure and connect Varnish.
Copied to your clipboarddocker compose run --rm deploy magento-command config:set system/full_page_cache/caching_application 2 --lock-envCopied to your clipboarddocker compose run --rm deploy magento-command setup:config:set --http-cache-hosts=varnishClear the cache.
Copied to your clipboarddocker compose run --rm deploy magento-command cache:cleanOptional: Restart services if the static content does not synchronize with all images after generation on build phase.
Copied to your clipboarddocker compose restartAccess the local storefront by opening one of the following URLs in a browser:
http://magento2.docker
https://magento2.docker
Use the default credentials to log in to the Admin (
https://magento2.docker/admin
).- username =
Admin
- password =
123123q
- username =
Access the default email service:
http://magento2.docker:8025
If you see the Your connection is not private
error message while using an HTTPS connection, click Advanced, then click the Proceed to magento2.docker (unsafe) link. If you use Google Chrome and there is no Advanced button, then type thisisunsafe
to bypass the security warnings. For CURL
requests, add the -k
or --insecure
option to ignore certificate warnings.