Services

Edit on GitHub

General Information

This page describes configuration options of the services shipped with Spryker in Docker by default. Find the list of the services below:

  • Database
    
  • ElasticSearch
    
  • Kibana UI
    
  • RabbitMQ
    
  • Swagger UI
    
  • Redis
    
  • Redis GUI
    
  • MailHog
    
  • Blackfire
    
  • New Relic
    
  • Before you start configuring a service, make sure to install or update Docker SDK to the latest version:
git clone https://github.com/spryker/docker-sdk.git ./docker
  • After enabling a service, make sure to apply the new configuration:

    1. Bootstrap docker setup:
    docker/sdk boot {deploy.yaml | deploy.dev.yaml}
    
    1. Once the job finishes, build and start the instance:
    docker/sdk up
    

Database

In Docker SDK, PostgreSQL is provided as a service by default, but you can switch to MySQL or MariaDB as described below.

MySQL

MySQL is an open source relational database management system based on Structured Query Language (SQL). MySQL enables data to be stored and accessed across multiple storage engines, including InnoDB, CSV and NDB. MySQL is also capable of replicating data and partitioning tables for better performance and durability.

See MySQL documentation for more details.

Configuration

Follow the steps below to switch database engine to MySQL:

  1. Adjust deploy.*.yaml in the services: section:
...
services:
    database:
        engine: mysql
        ...
        endpoints:
            localhost:3306:
...
  1. Regenerate demo data:
docker/sdk clean-data
docker/sdk demo-data

MariaDB

MariaDB is a community-developed, commercially supported fork of the MySQL relational database management system.

See MariaDB knowledge base for more details.

Configuration

Follow the steps below to switch the database service to MariaDB:

  1. Adjust deploy.*.yaml in the services: section:
...
services:
    database:
        engine: mysql
        version: mariadb-10.4
        ...
        endpoints:
            localhost:3306:
...
  1. Regenerate demo data:
docker/sdk clean-data
docker/sdk demo-data

ElasticSearch

Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.

See:

Configuration

Adjust deploy.*.yaml in the services: section to open the port used for accessing ElasticSearch:

services:
    search:
        engine: elastic
        endpoints:
            localhost:9200
                protocol: tcp

Kibana UI

Kibana is an open source analytics and visualization platform designed to work with Elasticsearch. You use Kibana to search, view, and interact with data stored in Elasticsearch indices. You can easily perform advanced data analysis and visualize your data in a variety of charts, tables, and maps.

See Kibana documentation to learn more.

In Docker SDK, Kibana UI is provided as a service by default.

Configuration

Follow the steps to configure an endpoint for Kibana UI:

  1. Adjust deploy.*.yaml in the services: section:
services:
    ...
    kibana:
        engine: kibana
        endpoints:
            {custom_endpoint}:
  1. Adjust host file:
echo "127.0.0.1 {custom_endpoint}" | sudo tee -a /etc/hosts

RabbitMQ

RabbitMQ is a messaging broker - an intermediary for messaging. It gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.

Configuration

Adjust deploy.*.yaml in the services: section to open the port used for accessing RabbitMQ:

services:
    broker:
    ...
        endpoints:
    ... 
            localhost:5672:
                protocol: tcp
            api.queue.spryker.local:

Swagger UI

Swagger UI allows anyone—be it your development team or your end consumers—to visualize and interact with the API’s resources without having any of the implementation logic in place. It’s automatically generated from your OpenAPI (formerly known as Swagger) Specification, with the visual documentation making it easy for back end implementation and client-side consumption.

See Swagger UI documentation for more details.

In Docker SDK, Swagger UI is provided as a service by default.

Rest API Reference in Spryker

Spryker provides the basic functionality to generate OpenApi schema specification for REST API endpoints. This document provides an overview of REST API endpoints. For each endpoint, you will find the URL, REST request parameters as well as the appropriate request and response data formats.

Configuration

Follow the steps to configure an endpoint for Swagger UI:

  1. Adjust deploy.*.yaml in the services: section:
services:
    ...
    swagger:
        engine: swagger-ui
        endpoints:
            {custom_endpoint}:
  1. Adjust the host file:
echo "127.0.0.1 {custom_endpoint}" | sudo tee -a /etc/hosts

Redis

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams.

See Redis documentation for more details.

Configuration

Adjust deploy.*.yaml in the services: section to open the port used for accessing Redis:

services:
    key_value_store:
        engine: redis
        endpoints:
            localhost:16379:
                protocol: tcp

Redis GUI

Redis Commander is a web management tool that provides a graphical user interface to access Redis databases and perform basic operations like view keys as a tree, view CRUD keys or import/export databases.

Configuration

Follow the steps to configure an endpoint for Redis Commander:

  1. Adjust deploy.*.yaml in the services: section:
services:
...    
    redis-gui:
        engine: redis-commander
        endpoints:
            {custom_endpoint}: //redis-commander.spryker.local:
  1. Adjust hosts file:
echo "127.0.0.1 {custom_endpoint}" | sudo tee -a /etc/hosts

MailHog

MailHog is a mail catcher service that is used with Spryker in Docker for Demo and Development environments. Developers use this email testing tool to catch and show emails locally without an SMTP (Simple Mail Transfer Protocol) server.

With the MailHog service, developers can:

  • configure an application to use MailHog for SMTP delivery;
  • view messages in the web UI or retrieve them via JSON API.

By default the following applies:

  • http://mail.demo-spryker.com/ is used to see incoming emails.
  • Login is not required
### Configuration Adjust `deploy.*.yaml` in the `services:` section to specify a custom endpoint: ```yaml services: ... mail_catcher: engine: mailhog endpoints: {custom_endpoint}: ```

Blackfire

Blackfire is a tool used to profile, test, debug, and optimize performance of PHP applications. It gathers data about consumed server resources like memory, CPU time, and I/O operations. The data and configuration can be checked via Blackfire web interface.

Configuration

Follow the steps to enable Blackfire:

  1. Adjust deploy.*.yaml in the image: section to enable the Blackfire PHP extension:
image:
    tag: spryker/php:7.3 # Use the same tag you had in `image:`
    php:
        ...
        enabled-extensions:
            - blackfire
  1. Adjust deploy.*.yaml in the services: section to configure Blackfire client:
services:
    ...
    blackfire:
        engine: blackfire
        server-id: {server_id}
        server-token: {server_token}
        client-id: {client_id}
        client-token: {client-token}

Alternative Configuration

Use the following configuration if you are going to change server or client details often, or if you don’t want to define them in your deploy file.

Follow the steps to enable Blackfire:

  1. Adjust deploy.*.yaml in the image: section to enable the Blackfire PHP extension:
image:
    tag: spryker/php:7.3 # Use the same tag you had in `image:`
    php:
        ...
        enabled-extensions:
            - blackfire
  1. Adjust deploy.*.yaml in the services: section to enable Blackfire service:
services:
    ...
    blackfire:
        engine: blackfire
  1. Pass Blackfire client details:
 BLACKFIRE_CLIENT_ID={client_id} BLACKFIRE_CLIENT_TOKEN={client-token} docker/sdk cli
  1. Pass Blackfire server details:
BLACKFIRE_SERVER_ID={client-token} BLACKFIRE_SERVER_TOKEN={server_token} docker/sdk up
Note

You can pass the server details only with the docker/sdk up command.

It is not obligatory to pass all the details as environment variables or define all the details in the deploy file. You can pass the details in any combination.

New Relic

New Relic is a tool used to track the performance of services, environment to quickly find and fix issues.

The solution consists of a client and a server. The client is used to collect the data about applications in an environment and send it to the server for further analysis and presentation. The server is used to aggregate, analyse and present the data.

Configuration

Follow the steps to enable New Relic:

  1. Adjust deploy.*.yml in the docker: section:
docker:
    newrelic:
        license: {new_relic_license)
  1. Adjust deploy.*.yml in the image: section:
image:
    tag: spryker/php:7.3 # the image tag that has been previously used in `image:`
    php:
        ...
        enabled-extensions:
            - newrelic

Alternative Configuration

Use this configuration if you are going to change New Relic license often or don’t want to define it in the deploy file.

Follow the steps to enable New Relic:

  1. Adjust deploy.*.yml in the docker: section:
docker:
    newrelic:
  1. Adjust deploy.*.yml in the image: section:
image:
    tag: spryker/php:7.3 # the image tag that has been previously used in `image:`
    php:
        ...
        enabled-extensions:
            - newrelic
  1. Pass the New Relic license:
NEWRELIC_LICENSE={new_relic_license} docker/sdk up
Note

You can pass the New Relic license only with the docker/sdk up command.