Skip to content

Automate configuration of multi store projects #696

Closed as not planned
Closed as not planned
@TerrorSquad

Description

@TerrorSquad

Hi everyone,

I've noticed that we don't have scripts that will automate configuring store access for existing multistore projects.
It would be nice to have a script such as bin/setup-domain-multistore.
The idea behind such as script is to run it after the database has been imported and composer install has been run.

It should do the following things:

  • update docker-compose.yml and add bind mounts to nginx.conf and default.conf files
    • I'd add these as bind mounts since doing it that way would allow us to edit the files easily from the outside without the need for an image rebuild. Update the file, restart container and you're done.
  • prepend a mapping directive to default.conf file where each store is accessible at magento-store-code.test (this is the simplified approach from the documentation
    • store-code should be fetched from the store table and converted to kebab case
  • update base URLs for each store
  • set cookie path and cookie domain config values for each store
  • update /etc/hosts and add a domain for each store

This could be extremely useful for existing projects that have many stores (10+). It would allow for faster setup which would lead to less time spent setting up the project, which is a win for all team members. Also, if for some reason, your local environment gets corrupted or is deleted, you could just run the script instead of doing all these steps manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions