Magento Setup with Warden

Blog
Spread the love

Docker : Docker is a ecosytem or platform where we will run the image and it will found from docker hub.
It is also an open source   platform to create, deploy and manage  containers on a common operating system (OS), with an ecosystem of allied tools

Warden : Warden is a  utility tool to run docker based environments and enables multiple local environments.

It also make customize CLI commands to update the database also .

How to install Docker?

To Install Docker follow This link
https://linuxize.com/post/how-to-install-and-use-docker-on-ubuntu-20-04/
Note: This is based on your ubuntu version which you can find from CLI command
lsb_release -a

How to install Warden ?

To Install Warden follow This link
https://docs.warden.dev/installing.html
Note:: This is for ubuntu only

  • sudo mkdir /opt/wardenCLI command to make directory of warden
  • sudo chown $(whoami) /opt/wardenCLI command to give owner access to warden that it will run from anywhere
  • git clone -b master https://github.com/davidalger/warden.git /opt/wardenCLI git command used to get clone the warden
  • echo ‘export PATH=”/opt/warden/bin:$PATH”‘ >> ~/.bashrcCLI command used to export path variables in ubuntu
  • PATH=”/opt/warden/bin:$PATH”Where path you can say will follow
  • warden svc up You can use it in globally as well in magento root directorywarden svc up :(CMD ) used to first time following installation, it will install the images .
  • sudo chmod 666 /var/run/docker.sockTo give the permission to docker socket

How Stop Apache service ?

  • sudo service apache2 stopRun this command to free port 80 .Also to use TRAEFIK services

Ubuntu resolvconf

Mostly in Ubuntu there is DNS located in any other IP .

Use the resolvconf service to add a permanent entry in your /etc/resolv.conf file.

Already there is resolv.conf is placed in your Ubuntu if it is not in your system

Install resolvconf

sudo apt update && sudo apt install resolvconf

edit the resolv.conf by CMD

sudo nano etcresolv.conf

add

nameserver 127.0.0.1

Restart network-manager

sudo service network-manager restart

Make folder inside var/www/html

mkdir wardenmagento

Run: warden env-init wardenmagento magento2

(this will generate the env file that will needed to setup env)

Run: warden sign-certificate exampleproject.test

(command to enable ssl certificate)

Make folder inside var/www/html

mkdir wardenmagento

Run: warden env-init wardenmagento magento2

(this will generate the env file that will needed to setup env . In env file there is all configuration of php , elastic search, mariadb)

Run: warden sign-certificate exampleproject.test

(command to enable ssl certificate)

  • Run: warden svc up(it will up all services that is maintained by docker)
  • Run: warden env up(it will up all containers and if it will first time then it will pull all images from docker hub and create containers .) It will take time
  • Run: warden shell(it will redirect to your magento root container here you will run command with magento related operations.)

Now Under

warden shell

it will open var/www/html/

Here you will install your magento

Run: sudo composer create-project –repository-url=https://repo.magento.com/ magento/project-enterprise-edition

enter username and password from auth.json or from magento market place

Run: composer2 create-project –repository-url=https://repo.magento.com/ magento/project-community-edition -vvv

It will install magento when you enter your public key and private key

You can also set configuration by globally for composer

composer global config http-basic.repo.magento.com

Now The process to setup the db and setup install command First thing the files will created in project-community-edition folder and you need to enter in folder and cut all files and paste inside wardenmagento

directory .

Run after warden shell

bin/magento setup:install \

–backend-frontname=backend \

–amqp-host=rabbitmq \

–amqp-port=5672 \

–amqp-user=guest \

–db-host=db \

–db-name=magento \

–db-user=magento \

–db-password=magento \

–search-engine=elasticsearch7 \

–elasticsearch-host=elasticsearch \

–elasticsearch-port=9200 \

–elasticsearch-index-prefix=magento2 \

–elasticsearch-enable-auth=0 \

–elasticsearch-timeout=15 \

–http-cache-hosts=varnish:80 \

–session-save=redis \

–session-save-redis-host=redis \

–session-save-redis-port=6379 \

–session-save-redis-db=2 \

–session-save-redis-max-concurrency=20 \

–cache-backend=redis \

–cache-backend-redis-server=redis \

–cache-backend-redis-db=0 \

–cache-backend-redis-port=6379 \

–page-cache=redis \

–page-cache-redis-server=redis \

–page-cache-redis-db=1 \

–page-cache-redis-port=6379

Run to setup the base url and secure base url

bin/magento config:set –lock-env web/unsecure/base_url \
“https://${TRAEFIK_SUBDOMAIN}.${TRAEFIK_DOMAIN}/”

bin/magento config:set –lock-env web/secure/base_url \
“https://${TRAEFIK_SUBDOMAIN}.${ TRAEFIK_DOMAIN}/”

Now you will be to see magento

https://app.wardenmagento.test/ — frontend url

https://app.wardenmagento.test/backend/ — backend url

https://rabbitmq.wardenmagento.test/ — rabbitmq url

https://elasticsearch.wardenmagento.test/ — elastic search url

Create admin with

bin/magento admin:user:create –admin-password=”${ADMIN_PASS}” –admin-user=”${ADMIN_USER}” –admin-firstname=”Local” –admin-lastname=”Admin” –admin-email=”adminexample@gmail.com”

Set elastic search

bin/magento config:set –lock-env catalog/search/engine elasticsearch7

bin/magento config:set –lock-env catalog/search/elasticsearch7_server_hostname elasticsearch

bin/magento config:set –lock-env catalog/search/elasticsearch7_server_port 9200

bin/magento config:set –lock-env catalog/search/elasticsearch7_index_prefix magento2

bin/magento config:set –lock-env catalog/search/elasticsearch7_enable_auth 0

bin/magento config:set –lock-env catalog/search/elasticsearch7_server_timeout 15

Disable Two fact auth by

By the way you can use the two factor auth as there is mail hog that will provide the code to admin login

bin/magento module:disable Magento_TwoFactorAuth

Note:

i)TRAEFIK_SUBDOMAIN and TRAEFIK_DOMAIN coming from .env file that is on root directory

ii) Also when you shut down your pc you need to do following things Go to root directory

Run: “warden svc up” then Run “warden env up” then Run “warden shell”

iii) when you got an error of DNS_PROBE error that is your magento application is not able to open you need to add

nameserver 127.0.0.1

by entering sudo nano etc/resolv.conf

iv) Make sure you have proper permissions of root folder from root directory and from container when you will enter

warden shell

bluethinkinc_blog

bluethinkinc_blog

2022-06-24

1

One Reply to “Magento Setup with Warden”

  • bluethinkinc_blog
    bluethinkinc_blog

    Nice Blog

    2022-06-24 at 8:24 am Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Find More Blogs

How to Add a Custom Tab to the Customer Order Detail Page in Magento 2

Spread the love Adding a custom tab to the Order Detail

Exception Handling in Java

Spread the love Introduction – Exception:An unwanted

How to add custom less file in Magento2

Spread the love Source files *.css included into layout

Spring Boot Microservices

Spread the love Microservices architecture has become

Implementation of WireMock for better testing

Spread the love WireMock is a flexible and powerful tool

Magento 2: How to selected default option in configurable options?

Spread the love Configurable products in Magento 2 allow

How To Implement Simple JWT Authentication in Django Rest Framework

Spread the love We’ll learn how to use simple JWT

Optimizing Search: Integrating Elasticsearch in Django Applications

Spread the love What is Elasticsearch? Elasticsearch is a

How to create Customer Segments

Spread the love In Magento 2, “customer

Proxy Design Pattern and Requisition List in Magento 2

Spread the love Requisition List in Magento 2 Requisition

bluethinkinc Blogs