All Projects → webkul → Magento2 Varnish Redis Ssl Docker Compose

webkul / Magento2 Varnish Redis Ssl Docker Compose

Deploy Magento2 with Varnish Cache and Redis with SSL termination using Docker-compose tool

Projects that are alternatives of or similar to Magento2 Varnish Redis Ssl Docker Compose

Ddev
DDEV-Local: a local PHP development environment system
Stars: ✭ 915 (+2372.97%)
Mutual labels:  magento, magento2, docker-compose
Dockerized lara
Build your Laravel App with Redis - Mongodb - MariaDB - Nginx - php7 - zsh
Stars: ✭ 9 (-75.68%)
Mutual labels:  docker-image, docker-compose, docker-container
Lumen Microservice
Lumen on Docker - Skeleton project with Nginx, MySQL & PHP 7 | Aws ECS, Google Kubernates, Azure Container Engine
Stars: ✭ 183 (+394.59%)
Mutual labels:  devops, docker-image, docker-compose
Uwsgi Nginx Flask Docker
Docker image with uWSGI and Nginx for Flask applications in Python running in a single container. Optionally with Alpine Linux.
Stars: ✭ 2,607 (+6945.95%)
Mutual labels:  docker-image, docker-container, nginx
Portainer
Making Docker and Kubernetes management easy.
Stars: ✭ 20,434 (+55127.03%)
Mutual labels:  docker-image, docker-compose, docker-container
Bitnami Docker Nginx
Bitnami nginx Docker Image
Stars: ✭ 198 (+435.14%)
Mutual labels:  ssl, docker-image, nginx
Docker Magento
Mark Shust's Docker Configuration for Magento
Stars: ✭ 1,123 (+2935.14%)
Mutual labels:  magento, magento2, docker-compose
Dockernotes
Docker入门精华版
Stars: ✭ 107 (+189.19%)
Mutual labels:  docker-image, docker-compose, docker-container
Dockercheatsheet
🐋 Docker Cheat Sheet 🐋
Stars: ✭ 3,301 (+8821.62%)
Mutual labels:  docker-image, docker-compose, docker-container
docker-haproxy-certbot
Dockerized HAProxy with Let's Encrypt certificates automatic renewal
Stars: ✭ 28 (-24.32%)
Mutual labels:  ssl, docker-compose, docker-image
Docker Postfix
Simple SMTP server / postfix null relay host for your Docker and Kubernetes containers. Based on Alpine Linux.
Stars: ✭ 163 (+340.54%)
Mutual labels:  docker-image, docker-compose, docker-container
Magento Nginx Config
Default Nginx config for Magento
Stars: ✭ 462 (+1148.65%)
Mutual labels:  magento, magento2, nginx
Larakube
Laravel app deployment for auto scaled Kubernetes cluster
Stars: ✭ 157 (+324.32%)
Mutual labels:  docker-image, docker-compose, nginx
Ansible Windows Docker Springboot
Example project showing how to provision, deploy, run & orchestrate Spring Boot apps with Docker Windows Containers on Docker Windows native using Packer, Powershell, Vagrant & Ansible
Stars: ✭ 58 (+56.76%)
Mutual labels:  devops, docker-compose, docker-container
Docker Workshop
Introduction to Docker tutorial
Stars: ✭ 124 (+235.14%)
Mutual labels:  docker-image, docker-compose, docker-container
Docker Magento Mutagen
Mage2click Docker-based development environment for Magento with mutagen.io sync for files on macOS
Stars: ✭ 64 (+72.97%)
Mutual labels:  magento2, docker-compose, nginx
Docker Compose Lamp
A basic LAMP stack environment built using Docker Compose.
Stars: ✭ 1,284 (+3370.27%)
Mutual labels:  docker-image, docker-compose, docker-container
Docker Laravel
🐳 Docker Images for Laravel development
Stars: ✭ 101 (+172.97%)
Mutual labels:  docker-image, docker-compose, nginx
Docker Compose Development
Clone and `bin/dev up`. Quickly start of developing locally with Nginx, PHP, Blackfire, Percona, Mailhog and Redis. Out of the box support for Magento2 Developer Box
Stars: ✭ 171 (+362.16%)
Mutual labels:  magento, magento2, docker-compose
Swirl
A web UI for Docker, focused on swarm cluster.
Stars: ✭ 332 (+797.3%)
Mutual labels:  docker-image, docker-compose, docker-container

Optimising Magento 2 with Varnish Cache, Redis and Nginx SSL termination on the Multi-container Architecture Using Docker-Compose tool.

This repository corresponds to architecture setup as mentioned in blog https://cloudkul.com/blog/integrate-magento-2-varnish-cache-redis-server-ssl-termination-using-docker-compose/ .

Docker-Compose Tool

As mentioned in Docker docs, Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a Compose file to configure your application’s services. Then, using a single command, you create and start all the services from your configuration.

With the help of docker-compose we can define containers to be built, their configuration, links, volumes, ports etc in a single file and it gets launched by a single command. We can add multiple servers and services just by adding them to docker-compose configuration file. This configuration file is in YAML format.

Getting started with docker-compose is a few steps process:

Create a Dockerfile defining the application environment. We can create separate Dockerfile for our different services. As Dockerfile are lightweight, so our application can be replicated anywhere.

Create a docker-compose.yml file defining services that needed for application run. We can define volumes to be mapped, ports to be exposed, links to be created, arguments to be passed etc in our docker-compose.yml file.

Run ‘docker-compose build’ to create Docker image. After creating Dockerfile, docker-compose.yml and placing our volumes at right places, we can create our image.

Run ‘docker-compose up -d’ to run the docker containers. After image build up, we can run all of our containers as mentioned in configuration files by this single command.

Dockerizing Magento 2, Varnish Cache, Redis server over SSL with Docker-Compose

Docker is an open-source project that can be integrated with almost all the applications allowing scope of isolation and flexibility. It can be integrated with Magento 2 as well. Magento is an e-commerce platform written in PHP and based on zend framework available under both open-source and commercial licenses.

Varnish cache is a web application accelerator also known as a caching HTTP reverse proxy. Varnish cache visits your server once to cache the page, then all future requests for the same page will be served by Varnish cache. Varnish acts a reverse proxy server that directs client requests to the back-end apache2 server. Whenever a client makes a request, Varnish server checks the content within the cache and in case data not found, it sends the request to backend server and fetch the content to client and keep a copy of the data as cache. When the same request is made, Varnish does not bother apache2 server, it just fetch the data from the cache. It provides an additional level of abstraction and control to ensure the smooth flow of network traffic between clients and servers.

Redis is an open source, BSD licensed, advanced key-value store that can optionally be used in Magento for back end and session storage. When first time page is loaded, a database is queried on the server. Redis caches the query. Next time other user loads the page the results are provided from the redis without quering the actual database.

Magento 2 works out of box with Varnish Cache and provides its own VCL file for its setup. Magento supports many backend caches like MemcacheD and APC that are commonly used. However, Redis has become a popular and powerful cache system for Magento and other web applications.

Nginx servers as reverse proxy server that receives traffic on port 80 and 443 and then proxy pass it to listening port of Varnish Cache server. It is done to deploy a way to direct both HTTP and HTTPS traffic to Varnish cache server which in turn, if needed, forward it apache2 server.

In this project, we are using:

Operating system: Ubuntu 16.04

Web Server: Apache2

Database Server: Mysql-server-5.7

Cache Server: Varnish 4.1

PHP version: PHP-7.1

Redis server: Redis

SSL server: Nginx 1.10.1

To begin with, please install docker and docker-compose on your ubuntu server.

Then follow the following steps:

1). Clone or download this repository as

git clone https://github.com/webkul/magento2-varnish-redis-ssl-docker-compose.git.

  1. Set mysql root credentials and name of the database to be created in database_server block ~/magento2-varnish-redis-ssl-docker-compose/docker-compose.yml:

mysql_password=

mysql_database=

3). Download Magento 2 version you wish to dockerize and upload it in directory magento2 in parallel docker-compose.yml.

Go to https://magento.com/tech-resources/download? .

4). Replace localhost in 'server_name' in ~/magento2-varnish-redis-ssl-docker-compose/ssl_server/default with your domain name or IP address.

5). Build the docker image.

docker-compose build

6). Check the built image as:

docker images

7). Run the containers from built image as:

docker-compose up -d

8). Check the running docker containers by command:

docker-compose ps

docker ps

Now, your server setup is all ready, now hit your domain name or IP to install Magento 2. Now to configure Varnish for Magento 2 and test its working, please refer to blog https://cloudkul.com/blog/magento-2-and-varnish-cache-integration-with-docker-compose/.

Use name or id of the mysql container as database host.

To configure Magento 2 for redis-server, please refer to blog https://cloudkul.com/blog/integrate-magento-2-varnish-cache-redis-server-ssl-termination-using-docker-compose/ .

Backing up Databases from Mysql-Server container

Although we had secured our application code keeping it on our host but database is as important as server code. So in order to keep their backup we schedule a shell script that will take backups of all the databases present in mysql-server container and keep them in archived from on our host. Shell script is present on ~/magento2-varnish-redis-ssl-docker-compose/backups/db_backup.sh. Please refer to blog https://cloudkul.com/blog/integrate-magento-2-varnish-cache-redis-server-ssl-termination-using-docker-compose/ for backup management.

If you face any issues, kindly report back.

GETTING SUPPORT

If you have any issues, contact us at [email protected] or raise ticket at https://webkul.uvdesk.com/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].