Migrate to Docker

Edit on GitHub

This page describes how you can migrate a non-Docker based project into a Docker based one. If you want to install Spryker from scratch, see Set up.

Install the prerequisites

  1. Follow one of the Docker installation prerequisites:

  2. Install the Spryker Core feature.

Set up .dockerignore

Create a new .dockerignore file to match the project file structure:

.git
.idea
node_modules
/vendor
/data
!/data/import
.git*
.unison*
/.nvmrc
/.scrutinizer.yml
/.travis.yml
/newrelic.ini

/docker
!/docker/deployment/

To learn more about the structure of the file, see .dockerignore file.

Set up configuration

In config/Shared, adjust or create a configuration file. The name of the file should correspond to your environment. See config_default-docker.php as an example.

Set up a deploy file

Set up a deploy file per your infrastructure requirements using the examples in the table:

DEVELOPMENT MODE DEMO MODE
B2C Demo Shop deploy file B2C Demo Shop deploy file
B2B Demo Shop deploy file B2B Demo Shop deploy file

Set up the installation script

In config/Shared, prepare the installation recipe that defines the way Spryker should be installed.

Use the following recipe examples:

Install the Docker SDK

  1. Clone the Docker SDK:
git clone https://github.com/spryker/docker-sdk.git ./docker
  1. Initialize docker setup:
docker/sdk bootstrap
Bootstrap

Once you finish the setup, you don’t need to run bootstrap to start the instance. You only need to run it after updating the Docker SDK or changing the deploy file.

  1. Build and run the application:
docker/sdk up

Make sure that, in the hosts file, all the domains from deploy.yml are defined as 127.0.0.1.

Endpoints

To verify that the migration is successful, make sure you can access the endpoints configured in the deploy file. To learn about the deploy file, see Deploy file reference.

RabbitMQ UI credentials

To access RabbitMQ UI, use spryker as a username and secret as a password. You can adjust the credentials in deploy.yml.

Remove Vagrant files

Remove the following Vagrant files:

  • config/install/development.yml
  • config/shared/config_default-development_*.php
  • /tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_default-development_*.php

Get the list of useful commands

To get the full and up-to-date list of commands, run docker/sdk help.

Next steps