shopware / paas

PaaS template based on production template
MIT License
10 stars 14 forks source link
hacktoberfest paas php shopware

Shopware PaaS

This repository is deprecated

This approach is deprecated and will be replaced by a Flex PaaS recipe. See docs

This template builds Shopware PaaS using Composer. To get started on PaaS, please visit https://developer.shopware.com/docs/products/paas

Services

First deployment

  1. The first time the site is deployed, Shopware's command line installer will run and initialize Shopware. It will not run again unless the installer/installed is removed. (Do not remove that file unless you want the installer to run on the next deploy!)

  2. The installer will create an administrator account with username/password admin/shopware. You need to change this password immediately. Not doing so is a security risk.

  3. As the theme assets are generated in the build hook and cannot be changed in runtime, we need to dump the theme configuration and run a second deployment to have theme assets build. See Stateless Builds section for this

Customizations

This project is built on the shopware/production repo. All plugins MUST be installed through Composer. The in-browser plugin manager will not work as the disk is read-only.

The following changes have been made relative to a plain Shopware production project. If using this project as a reference for your own existing project, replicate the changes below to your project.

Stateless Builds

This build uses "Building without Database".

To support the stateless build for the theme, the theme-config is checked into git for it being available during the build process (an alternative is to store it on an external object storage).

To update the config

IMPORTANT: You have to run this once after the first install, otherwise the Frontend will not load css/js files correctly.

Optional additions

Elasticsearch

  1. Add Elasticsearch to .platform/services.yaml
  2. Add a relationship for it in .platform.app.yaml
  3. Follow the steps mentioned in the documentation to prepare your instance. SHOPWARE_ES_HOSTS, SHOPWARE_ES_INDEXING_ENABLED and SHOPWARE_ES_INDEX_PREFIX are set in platformsh-env.php.
  4. If all is good, you can enable via SHOPWARE_ES_ENABLED (either uncomment in platformsh-env.php or add as a variable)

RabbitMQ

  1. Add RabbitMQ in .platform/services.yaml
  2. Add a relationship for it in .platform.app.yaml
  3. Push to Git (so RabbitMQ is provisioned)
  4. For RabbitMQ to work, you need to manually add a queue named shopware-queue and a messages exchange. To do this you can e.g. use the platform CLI to open a tunnel (ssh -L 15672:rabbitmqqueue.internal:15672 $(platform ssh --pipe -A app)) and open the UI via http://localhost:15672/. You can get the credentials via platform relationships. RABBITMQ_URL is set in platformsh-env.php.
  5. composer require enqueue/amqp-bunny
  6. Uncomment config/packages/enqueue.yaml

Fastly

  1. Make sure you have at least Shopware 6.4.11.0
  2. Make sure FASTLY_API_TOKEN and FASTLY_SERVICE_ID are set in the environment or contact Support when its missing.
  3. Enable Fastly config in .platform.app.yaml by removing hashtag before mv config/packages/fastly.yaml.dist config/packages/fastly.yaml
  4. Push the new config and Fastly is enabled

References