Start the Docker environment

Production mode is the default configuration setting for launching the Docker environment with read-only filesystem permissions. This option builds the Docker environment in production mode and verifies configured service versions.

See Configure Docker for details about customizing the Docker configuration.

Prerequisites:

Complete the installation steps.

To launch the Docker environment in production mode:

  1. In your local environment, start the Docker configuration generator. You can use the service configuration options, such as --php, to specify a version.

    1
    
    ./vendor/bin/ece-docker build:compose
    
  2. Optional: If you have a custom PHP configuration file, copy the default configuration DIST file to your custom configuration file and make any necessary changes.

    1
    
    cp .docker/config.php.dist .docker/config.php
    
  3. Build files to containers and run in the background.

    1
    
    docker-compose up -d
    
  4. Install Adobe Commerce in your Docker environment.

    • Build Adobe Commerce in the Docker container.

      1
      
      docker-compose run --rm build cloud-build
      
    • Deploy Adobe Commerce in the Docker container.

      1
      
      docker-compose run --rm deploy cloud-deploy
      
    • Run post-deploy hooks.

      1
      
      docker-compose run --rm deploy cloud-post-deploy
      
  5. Configure and connect Varnish.

    1
    
    docker-compose run --rm deploy magento-command config:set system/full_page_cache/caching_application 2 --lock-env
    
    1
    
    docker-compose run --rm deploy magento-command setup:config:set --http-cache-hosts=varnish
    
  6. Clear the cache.

    1
    
    docker-compose run --rm deploy magento-command cache:clean
    
  7. Optional: Restart services if the static content does not synchronize with all images after generation on build phase.

    1
    
    docker-compose restart
    
  8. Access the local storefront by opening one of the following URLs in a browser:

    • http://magento2.docker

    • https://magento2.docker

  9. Use the default credentials to log in to the Admin (https://magento2.docker/admin).

    • username = Admin
    • password = 123123q
  10. 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.