Skip to content

Latest commit

 

History

History
117 lines (85 loc) · 4.63 KB

06-integrating-the-docker-sdk-into-existing-projects.md

File metadata and controls

117 lines (85 loc) · 4.63 KB

Integrating the Docker SDK into existing projects

This page describes how you can convert a non-Docker based project into a Docker based one. If you want to install Spryker in Docker from scratch, start with Development Mode or Demo Mode.

Prerequisites

To start integrating Docker into your project:

  1. Follow the one of the Docker installation prerequisites:
  1. Integrate the Spryker Core feature into your project.

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/

See .dockerignore file to learn more about the structure of the 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.

Make sure to adjust the configuration for each separate store. See config_default-docker_DE.php as an example.

Set up a Deploy file

Set up a Deploy file per your infruscturcure 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

Follow the steps to install the Docker SDK:

  1. Fetch Docker SDK tools:
git clone https://github.com/spryker/docker-sdk.git ./docker

:::(Warning) (Verification) Make sure docker 18.09.1+ and docker compose 2+ are installed:

$ docker version
$ docker compose version

:::

  1. Initialize docker setup:
docker/sdk bootstrap

:::(Info) (Bootstrap) Once you finish the setup, you don't need to run bootstrap to start the instance. Run it only after:

  • Docker SDK version update
  • Deploy file update :::
  1. Build and run Spryker applications:
docker/sdk up

:::(Warning) () Ensure that, in the hosts file in the local environment, all the domains from deploy.yml are defined as 127.0.0.1. :::

Endpoints

To ensure that the installation is successful, make sure you can access the configured endpoints from the Deploy file. See Deploy file reference - 1.0 to learn about the Deploy file.

:::(Info) (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. :::

Getting the list of useful commands

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

Next steps