Sylius signed a strategic partnership with Platform.sh, extending their offer with Sylius Cloud!
Platform.sh is a modern Platform-as-a-Service (PaaS) solution that allows businesses to benefit from the cloud environment while keeping access to the code and data. It is a flexible, secure, and unified platform designed to facilitate building, running, and scaling any application on the web. For example, online businesses can deploy various projects and create multiple environments where all the features and changes can be tested before they go live without impacting the main project.
The cooperation between Sylius and Platform.sh allowed to create a solution that is ideally suited to the needs of Sylius – both from the technical and business side. As a result, the Sylius Cloud powered by Platform.sh was introduced to the offer, providing a simplified way to manage the complex infrastructure, customize the platform, and scale effortlessly as the business grows.
Platform.sh currently serves over 5,000 customers worldwide, providing 24/7 support, automated infrastructure, and bullet-proof security from one reliable PaaS.
Purpose of cooperation between Sylius and Platform.sh
According to the Sylius team, the answer was pretty straightforward – they needed a recommended PaaS solution for Sylius Cloud that the community could trust. As the years went by, Platform.sh became a market standard valued in many open-source projects, including the fundamental framework for Sylius – Symfony.
Building and managing infrastructure can be challenging, but Sylius believes that a tool like Platform.sh can simplify the whole process and, as a result, enhance the product experience.
Saying that, Sylius Cloud, powered by Platform.sh, is an excellent choice for every Sylius user, whether they are developers working on a pet project, merchants operating on a global scale, or agencies requiring multiple environments during the project development stage.
The deployment of Sylius Cloud is a quick and easy process, as described below.
Sylius Cloud as a new Platform.sh project and environment
Given that Sylius Cloud operates on Platform.sh, each new environment must be established either through the Platform.sh dashboard or via Platform.sh’s CLI tools. However, before setting up an environment, it’s necessary to initiate the project exclusively on the Platform.sh panel. To fully leverage the capabilities of Sylius Cloud when initiating a new project, select the „Create from scratch” option, as shown in the screenshot below:
While creating a new project, a new environment is created automatically, which is connected to the project’s git repository branch.
Then, new environments can be specified through the platform command by choosing, for example, its type, name, parent environment, and other optional parameters. Once the environment is created, the application is ready for deployment. The steps can be repeated to create additional environments for development, testing, or other purposes.
With Sylius Cloud powered by Platform.sh, the time required for project setup is reduced to a minimum. The whole process is simplified, allowing developers to focus on the project as soon as possible without the need to manage the required resources and infrastructure without a deep understanding of all the required dependencies.
Configuring Platform.sh and Sylius is an equally straightforward process; let’s see how it’s done.
Sylius Cloud configuration
Sylius Cloud via Platform.sh provides an efficient and scalable hosting option for Sylius projects. In the setup process, users can select from various sophisticated options, including CPU count, memory size, and disk capacity. These features are particularly useful for managing increased demand or traffic spikes during events like Black Friday, Christmas sales, or similar instances requiring additional resources to deliver a cutting-edge customer experience.
The solution adds the possibility of hosting the Sylius instance on one of the following cloud service providers:
- Amazon Web Services (AWS)
- Google Cloud Platform (GCP)
- Microsoft Azure
- OVHCloud
Simple configuration file
The web application can be managed from a central panel using a configuration file and an intuitive Graphical User Interface (GUI).
name: sylius
type: php:8.3
relationships:
database: "db:mysql"
disk: 2048
mounts:
"config/jwt":
source: local
source_path: jwt
"/var/cache":
source: local
source_path: cache
"/var/log":
source: local
source_path: log
"/var/sessions":
source: local
source_path: sessions
"/public/assets":
source: local
source_path: assets
"/public/bundles":
source: local
source_path: bundles
"/public/uploads":
source: local
source_path: uploads
"/public/media":
source: local
source_path: media
web:
locations:
"/":
root: "public"
passthru: "/index.php"
allow: true
expires: -1
scripts: true
'/assets/shop':
expires: 2w
passthru: true
allow: false
rules:
'\.(css|js|jpe?g|png|gif|svgz?|ico|bmp|tiff?|wbmp|ico|jng|bmp|html|pdf|otf|woff2|woff|eot|ttf|jar|swf|ogx|avi|wmv|asf|asx|mng|flv|webm|mov|ogv|mpe|mpe?g|mp4|3gpp|weba|ra|m4a|mp3|mp2|mpe?ga|midi?)$':
allow: true
'/media/image':
expires: 2w
passthru: true
allow: false
rules:
'\.(jpe?g|png|gif|svgz?)$':
allow: true
'/media/cache/resolve':
passthru: "/index.php"
expires: -1
allow: true
scripts: true
'/media/cache':
expires: 2w
passthru: true
allow: false
rules:
'\.(jpe?g|png|gif|svgz?)$':
allow: true
variables:
env:
APP_ENV: 'prod'
APP_DEBUG: 0
N_PREFIX: /app/.global
build:
flavor: composer
dependencies:
nodejs:
n: "*"
yarn: "*"
php:
composer/composer: '^2'
crons:
sylius-cancel-unpaid-orders:
spec: "0 2 * * *"
cmd: "php bin/console --env=prod sylius:cancel-unpaid-orders"
sylius-remove-expired-carts:
spec: "0 2 * * *"
cmd: "php bin/console --env=prod sylius:remove-expired-carts"
hooks:
build: |
set -e
curl -fs https://get.symfony.com/cloud/configurator | bash
n auto
hash -r
yarn install --frozen-lockfile
yarn build:prod
deploy: |
set -e
symfony-deploy
rm -rf var/cache/*
mkdir -p public/media/image
bin/console sylius:fixtures:load -n
bin/console lexik:jwt:generate-keypair --skip-if-exists
bin/console assets:install --symlink --relative public
bin/console cache:clear
The management console
The management console is designed to be responsive and user-friendly. Users can filter lists by searching for specific projects or selecting a different organization from the top-left menu. Upon choosing a project, users can modify its settings. The same goes for the environments – the settings of each one can be modified according to the needs.
This PaaS solution offers several exciting features and benefits that aim to streamline the process of managing and developing web applications in the cloud environment. These include, for instance, Continuous Integration and Continuous Deployment (CI/CD), cloning environment features, and automatic scaling. These aspects and much more are described in the Sylius blog, which is devoted solely to Sylius Cloud and cooperation with Platform.sh.
Sylius Platform – The Headless eCommerce Open-Source Tailored For Your Needs