From 29adb10f1beade27e0c0a8f35152aedb82c19326 Mon Sep 17 00:00:00 2001 From: Ferror Date: Thu, 2 Jun 2022 13:10:35 +0200 Subject: [PATCH] [docker][docs]Deploy Sylius with Docker --- docs/book/installation/index.rst | 1 + .../installation/installation_with_docker.rst | 33 +++++++++++++++++++ docs/book/installation/map.rst.inc | 1 + docs/cookbook/deployment/docker.rst | 33 +++++++++++++++++++ docs/cookbook/deployment/map.rst.inc | 1 + docs/cookbook/index.rst | 1 + .../deployment.rst | 6 ++-- .../installation.rst | 6 +++- 8 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 docs/book/installation/installation_with_docker.rst create mode 100644 docs/cookbook/deployment/docker.rst diff --git a/docs/book/installation/index.rst b/docs/book/installation/index.rst index 4ee4c448bf..b4f1857250 100644 --- a/docs/book/installation/index.rst +++ b/docs/book/installation/index.rst @@ -8,6 +8,7 @@ The process of installing Sylius together with the requirements to run it effici requirements installation + installation_with_docker sylius_plus_installation upgrading sylius_plus_upgrading diff --git a/docs/book/installation/installation_with_docker.rst b/docs/book/installation/installation_with_docker.rst new file mode 100644 index 0000000000..770994ceed --- /dev/null +++ b/docs/book/installation/installation_with_docker.rst @@ -0,0 +1,33 @@ +.. index:: + single: Installation + +Installation with Docker +======================== + +Docker +------ + +Docker is an open-sourced platform for developing, delivering, and running applications. Docker allows you to separate your +application from your infrastructure, simplifies software delivery. Docker allows you to manage infrastructure in the +same way that applications are managed. Implementing the platform methodology, enables fast code delivery, +testing, and implementation. Docker significantly reduces the delay between writing the code and running it in the production environment. + +.. note:: + + Make sure you have `Docker `_ installed on your local machine. + +Development +----------- + +Sylius Standard comes with the `multi-stage build `_. +You can execute it via the ``docker compose up -d`` command in your favorite terminal. Please note that the speed of building images +and initializing containers depends on your local machine and internet connection - it may take some time. Then enter ``localhost`` in your browser or execute ``open localhost`` in your terminal. + +.. code-block:: bash + + docker compose up -d + open localhost + +.. tip:: + + :doc:`Learn how to deploy Sylius-Standard production ready Docker Compose configuration ` diff --git a/docs/book/installation/map.rst.inc b/docs/book/installation/map.rst.inc index e8f8a9d494..e77d0e512d 100644 --- a/docs/book/installation/map.rst.inc +++ b/docs/book/installation/map.rst.inc @@ -1,5 +1,6 @@ * :doc:`/book/installation/requirements` * :doc:`/book/installation/installation` +* :doc:`/book/installation/installation_with_docker` * :doc:`/book/installation/sylius_plus_installation` * :doc:`/book/installation/upgrading` * :doc:`/book/installation/sylius_plus_upgrading` diff --git a/docs/cookbook/deployment/docker.rst b/docs/cookbook/deployment/docker.rst new file mode 100644 index 0000000000..c2919f1c6b --- /dev/null +++ b/docs/cookbook/deployment/docker.rst @@ -0,0 +1,33 @@ +How to deploy Sylius with Docker? +================================= + +The simplest way to deploy your Sylius store with Docker is to use the template provided in the Sylius-Standard ``docker-compose.prod.yml`` configuration file. + +.. tip:: + + When using a Virtual Private Server (VPS) we recommend having at least 2GB of RAM memory. + +1. Install Docker on your VPS +----------------------------- + +.. code-block:: bash + + curl -fsSL https://get.docker.com -o get-docker.sh + sudo sh get-docker.sh + +2. Execute Docker Compose Configuration +--------------------------------------- + +.. code-block:: bash + + export MYSQL_PASSWORD=SLyPJLaye7 + docker compose -f docker-compose.prod.yml up -d + +.. tip:: + + Deploying the database on the same machine as the application is not the best practice. **Use Managed Database solution instead.** + +Learn more +---------- + +* `Check out Docker learning recommendations! `_ diff --git a/docs/cookbook/deployment/map.rst.inc b/docs/cookbook/deployment/map.rst.inc index 18f3696ddc..284f2145cd 100644 --- a/docs/cookbook/deployment/map.rst.inc +++ b/docs/cookbook/deployment/map.rst.inc @@ -3,3 +3,4 @@ * :doc:`/cookbook/deployment/cron-jobs` * :doc:`/cookbook/deployment/symfonycloud` * :doc:`/cookbook/deployment/artifakt` +* :doc:`/cookbook/deployment/docker` diff --git a/docs/cookbook/index.rst b/docs/cookbook/index.rst index 862282e695..9742116f97 100644 --- a/docs/cookbook/index.rst +++ b/docs/cookbook/index.rst @@ -123,6 +123,7 @@ Deployment deployment/cloudways deployment/cron-jobs deployment/artifakt + deployment/docker .. include:: /cookbook/deployment/map.rst.inc diff --git a/docs/getting-started-with-sylius/deployment.rst b/docs/getting-started-with-sylius/deployment.rst index ff5387fcfe..61333cbaff 100644 --- a/docs/getting-started-with-sylius/deployment.rst +++ b/docs/getting-started-with-sylius/deployment.rst @@ -3,9 +3,9 @@ Deployment Development usually takes most of the time in project implementation, but we should not forget about what's at the end of this process - application deployment into the server. We believe, that it should be as easy and understandable as possible. -There are many servers which you can choose for your store deployment: in our documentation you will find an easy Platform.sh guide. -Check it out! +Check out our deployment cookbooks: + .. tip:: @@ -13,6 +13,7 @@ Check it out! - 👉 :doc:`How to deploy Sylius to Symfony Cloud? ` - 👉 :doc:`How to deploy Sylius to Artifakt? ` - 👉 :doc:`How to deploy Sylius to Cloudways? ` + - 🐳 :doc:`How to deploy Sylius with Docker ` Learn more about the deployment platforms ----------------------------------------- @@ -21,3 +22,4 @@ Learn more about the deployment platforms * `Symfony Cloud `_ * `Artifakt.com `_ * `Cloudways PHP Hosting `_ +* `Docker `_ diff --git a/docs/getting-started-with-sylius/installation.rst b/docs/getting-started-with-sylius/installation.rst index 303b3415e5..b8b4491ec8 100644 --- a/docs/getting-started-with-sylius/installation.rst +++ b/docs/getting-started-with-sylius/installation.rst @@ -2,7 +2,7 @@ Installation ============ So you want to try creating an online shop with Sylius? Great! The first step is the most important one, so let's start -with the Sylius project installation via Composer. We will be using the latest stable version of Sylius - ``1.7``. +with the Sylius project installation via Composer. We will be using the latest stable version of Sylius - ``1.11``. Before installation ------------------- @@ -28,6 +28,10 @@ The easiest way to install Sylius on your local machine is to use the following It will create a ``MyFirstShop`` directory with a brand new Sylius application inside. +.. note:: + + Are you familiar with Docker? Check out the :doc:`Sylius Installation Guide with Docker ` + .. warning:: Beware! The next step includes the database setup. It will set your database credentials