dockercontainersshopware6storefront

Shopware 6: How can I set storefront domain URL in Shopware docker container using CLI command


I have a Shopware 6 docker container running on port 8080. I am installing and activating plugins using these commands.

docker cp $PLUGIN_NAME $SHOPWARE_CONTAINER_ID:/var/www/html/custom/plugins/

docker exec -it $SHOPWARE_CONTAINER_ID /bin/bash -c "cd /var/www/html && bin/console plugin:install --activate $PLUGIN_NAME"

By default, the domain URL of the storefront is http://localhost/. How can I configure Shopware to use http://localhost:8080/ as the storefront domain URL using the CLI command?

Is there any way to do it using CLI command? Any help would be appreciated.


Solution

  • The command bin/console sales-channel:update:domain newdomain.com will update the sales channel domain for every sales channel.

    To only replace 1 specific domain with a new domain, you can use the 'previousDomain' option.

    For you example, I would try the following command, if 'localhost' is the currently configured domain:

    bin/console sales-channel:update:domain "localhost:8080" localhost