• Overview
    Frameworks
    • Drupal
    • WordPress
    • Symfony
    • Magento
    • See all frameworks
    Features
    • Observability
    • Auto-scaling
    Solutions
    • Marketing Teams
    • Retail
    • Higher Education
  • Pricing
  • Featured articles
    • Switching to Platform.sh can help IT/DevOps organizations drive 219% ROI
    • Organizations, the ultimate way to manage your users and projects
  • Support
  • Docs
  • Contact
  • Login
  • Free Trial
Blog
Shared network storage now available

Shared network storage now available

April 17, 2019
Larry Garfield
Larry Garfield
Director of Developer Experience

Since Platform.sh launched support for worker instances last year, the number-one feature request has been a way to share file mounts between the web application and its workers. We're happy to announce that it can now be done!

Cool! How?

The solution is the new network-storage service container, which runs like any other service in your cluster and offers up mount points instead of network ports. You can add one to your cluster through services.yaml just this easily:

files:
    type: network-storage:1.0
    disk: 2048

That creates a new network service named files (you can name it anything), with a disk capacity of 2 GB.

Now, in .platform.app.yaml, you can declare file mounts that point at that network service rather than at the local disk.

mounts:
    'web/uploads':
        source: service
        service: files
        source_path: uploads

That creates a mount point in the web/uploads directory, which points at the files service. The source_path is the subdirectory in the service. If you have multiple applications mount the same source_path on the same service, poof, they have access to the same files over the network.

It works for workers

That includes workers, too. A local mount source creates a container-specific mount on each app container—one on the web instance and one on the worker instance. A service mount source, however, inherits to both instances and points to the same directory on the storage service. No extra work needed.

It's also possible to define custom mounts for the workers and web instance separately, which can be local or network mounts. And you can mix and match local and service mounts however you need. See the Network Storage documentation for more details.

Get the latest Platform.sh news and resources
Subscribe

Related Content

PHP 8.2 lays new ground on Platform.sh

PHP 8.2 lays new ground on Platform.sh

Company
AboutSecurity and complianceTrust CenterBoard and investorsCareersPressContact us
System StatusPrivacyTerms of ServiceImpressumWCAG ComplianceManage your cookie preferencesReport a security issue
© 2022 Platform.sh. All rights reserved.
Supported by Horizon 2020's SME Instrument - European Commission 🇪🇺