-
Notifications
You must be signed in to change notification settings - Fork 38
Shopware6 object storage docs #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
f8d600e
6541ec5
9735ad0
09d76e5
70cb376
8e30485
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,107 @@ | ||||||
| --- | ||||||
| myst: | ||||||
| html_meta: | ||||||
| description: Configure remote storage for Shopware 6.x. Learn how to configure | ||||||
| Shopware 6 to start storing files in your bucket. | ||||||
| title: How to Configure Remote Storage for Shopware 6.x | Hypernode | ||||||
| --- | ||||||
|
|
||||||
| # How to Configure Remote Storage for Shopware 6.x | ||||||
|
|
||||||
| Shopware 6.x supports remote storage for different types of files, allowing you to store assets such as product images, documents, and other media in an external storage service instead of the local server. | ||||||
|
|
||||||
| Using remote object storage in Shopware 6 provides several benefits, including: | ||||||
|
|
||||||
| - Offloading storage from your server, reducing the load on your server, and improving performance. | ||||||
| - Allows you to make use of [horizontal scaling](../../hypernode-platform/autoscaling/how-does-horizontal-autoscaling-work), as you can easily add more servers without having to worry about syncing files between them. | ||||||
| - Allows for effortless storage capacity scaling, as you can easily increase the storage capacity of your remote storage location. | ||||||
| - Serving assets from a CDN, which can improve the performance of your website. | ||||||
|
|
||||||
| ## Configuring the application | ||||||
|
|
||||||
| Configuring Shopware 6 to start storing files in your bucket is done by modifying the the general bundle configuration file located at `config/packages/shopware.yml` in your shopware root directory. | ||||||
|
|
||||||
| **Hypernode Object Storage and other S3 compatible providers** | ||||||
|
|
||||||
| If you're using Hypernode Object Storage, you need to make sure that the configuration file contains the following: | ||||||
|
|
||||||
| ```yaml | ||||||
| shopware: | ||||||
| filesystem: | ||||||
| public: | ||||||
| type: 'amazon-s3' | ||||||
| config: | ||||||
| bucket: 'main' | ||||||
| region: 'EU' | ||||||
| endpoint: 'management url' | ||||||
| use_path_style_endpoint: true | ||||||
| credentials: | ||||||
| key: 'access key' | ||||||
| secret: 'secret key' | ||||||
|
|
||||||
| ``` | ||||||
|
|
||||||
| You can get the required management URL, access key, and secret key by running `hypernode-object-storage info` with the `--with-credentials` flag: | ||||||
|
|
||||||
| ```console | ||||||
| app@testapp ~ # hypernode-object-storage info --with-credentials | ||||||
| +--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+ | ||||||
| | UUID | Name | Plan | Hypernodes | Management URL | Access Key | Secret Key | | ||||||
| +--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+ | ||||||
| | 12345678-9012-3456-b7e3-19ab43df4a23 | testappbucket1 | OS200GB | testapp | https://example.ams.objectstore.eu | abcd1234 | abcd1234 | | ||||||
| +--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+ | ||||||
| ``` | ||||||
|
|
||||||
| **AWS S3** | ||||||
|
|
||||||
| If you're using Amazon's S3 bucket, your configuration file should include the following: | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ```yaml | ||||||
| shopware: | ||||||
| filesystem: | ||||||
| public: | ||||||
| type: 'amazon-s3' | ||||||
| config: | ||||||
| bucket: 'your bucket name' | ||||||
| region: 'your aws region' | ||||||
| credentials: | ||||||
| key: 'your aws access key' | ||||||
| secret: 'your aws secret key' | ||||||
|
|
||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing whitespasce |
||||||
| ``` | ||||||
|
|
||||||
| ## Syncing the files | ||||||
|
|
||||||
| You can use the following to sync the files between your local and remote storage: | ||||||
|
|
||||||
| ```bash | ||||||
| hypernode-object-storage objects sync pub/media/ s3://my_bucket_name/media/ | ||||||
|
dominik-matic marked this conversation as resolved.
Outdated
|
||||||
| hypernode-object-storage objects sync var/import_export s3://my_bucket_name/import_export | ||||||
| ``` | ||||||
|
|
||||||
| The `hypernode-object-storage objects sync` command runs the sync process in the background | ||||||
| and provides the Process ID (PID). You can monitor the sync progress using: | ||||||
|
|
||||||
| ```bash | ||||||
| hypernode-object-storage objects show PID | ||||||
| ``` | ||||||
|
|
||||||
| Alternatively, you can use the AWS CLI directly: | ||||||
|
|
||||||
| ```bash | ||||||
| aws s3 sync pub/media/ s3://my_bucket_name/media/ | ||||||
|
dominik-matic marked this conversation as resolved.
Outdated
|
||||||
| aws s3 sync var/import_export s3://my_bucket_name/import_export | ||||||
| ``` | ||||||
|
|
||||||
| ## Serving assets from your S3 bucket | ||||||
|
|
||||||
| To serve media assets directly from your S3 bucket, you need to adjust your nginx configuration. | ||||||
| Fortunately, `hypernode-manage-vhosts` [simplifies this process for you](../../hypernode-platform/nginx/hypernode-managed-vhosts.md#object-storage-and-hypernode-managed-vhosts). | ||||||
|
|
||||||
| ### Configuring Amazon S3 bucket policies | ||||||
|
|
||||||
| If you’re using Amazon S3, ensure that your S3 bucket has ACLs enabled. | ||||||
|
|
||||||
| ## Shopware remote storage documentation | ||||||
|
|
||||||
| - [Filesystem](https://developer.shopware.com/docs/guides/hosting/infrastructure/filesystem.html) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it's just one link, I think it's better to move this one to the |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace