Skip to content

lnoering/magento2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lnoering/magento2

Leonardo Noering - To improve the knowledge

Improve the knowledge

Using this repo to improve the knowledge

Table of contents

Install

  • Use this command to install the first time.
bin/magento setup:install --base-url="http://localhost/" --db-host="db" --db-name="magento" --db-user="magento" --db-password="magento" --admin-firstname="admin" --admin-lastname="admin" --admin-email="user@example.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Sao_Paulo" --use-rewrites="1" --backend-frontname="adminaccess" --opensearch-host="opensearch" --opensearch-port="9200" --opensearch-enable-auth="false" --opensearch-username="" --opensearch-password="" --base-url-secure="https://localhost/" --search-engine="opensearch" --session-save="redis" --session-save-redis-host="redis" --session-save-redis-port="6379" --session-save-redis-password="" --session-save-redis-timeout="2.5" --session-save-redis-persistent-id="" --session-save-redis-db="2" --session-save-redis-compression-threshold="2048" --session-save-redis-compression-lib="gzip" --session-save-redis-log-level="4" --session-save-redis-max-concurrency="6" --session-save-redis-break-after-frontend="5" --session-save-redis-break-after-adminhtml="30" --session-save-redis-first-lifetime="600" --session-save-redis-bot-first-lifetime="60" --session-save-redis-bot-lifetime="7200" --session-save-redis-disable-locking="0" --session-save-redis-min-lifetime="60" --session-save-redis-max-lifetime="2592000" --cache-backend="redis" --cache-backend-redis-server="redis" --cache-backend-redis-db="0" --page-cache="redis" --page-cache-redis-server="redis" --page-cache-redis-db="1"

-- URL SET -- ADMIN USER -- SEARCH -- CACHE (Default caching, Page Cache, Session)

  • Disable the two factor auth
bin/magento module:disable {Magento_AdminAdobeImsTwoFactorAuth,Magento_TwoFactorAuth}

Server

Digital Ocean

Digital Ocean

Creating droplet

  • Create one droplet with centos 9.
  • Access the console by web interface.
    • Droplets > [ Choice your droplet ] > Access > Recovery Console
  • Change configs at ssh to accept login.
    • PermitRootLogin yes
    • PasswordAuthentication yes
vi /etc/ssh/sshd_config
  • Restart ssh service
service sshd restart
  • Now access by ssh from your machine.
  • Will need create 4 droplets.
    • PHP/NGINX OR APACHE
    • OPENSEARCH
    • DATABASE
    • REDIS (Session and cache)

Server Configs

  • Create the web user
useradd web
  • Set the password to this user
passwd web

Installing the docker

  • Update
sudo yum check-update
  • Install
curl -fsSL https://get.docker.com/ | sh
  • Start the docker
sudo systemctl start docker
  • Check it's working
sudo systemctl status docker
  • Enable to start the docker on reboot.
sudo systemctl enable docker
  • I created one linux user to not use root every time. (I created the user web)
sudo usermod -aG docker web

Docker structure

curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash

Docker access by internet

  • Droplets communications.
    • I used the Firewall from Digital Ocean panel to limit the access. (External Access) Creting sprecific rules to droplets.

Docker with ssl

  • I used the root user to run because the permissions, after that to shared to container app, I change the owner to web.

Git

  • Install
sudo yum install git
  • Config
git config --global user.name "Deployer"
git config --global user.email "lnoering@gmail.com"

Server Deploy Configs

  • Run this commands at the server
mkdir /home/web/app/code
mkdir /home/web/app/code/magento.git
cd /home/web/app/code/magento.git
git init --bare
  • Set the post-receive hook to git
mkdir /home/web/app/code/checkout
cd /home/web/app/code/magento.git/hooks
touch post-receive
chmod +x post-receive
vim post-receive
  • Copy the data of post-receive from .configs/git bare/post-receive

Server Push Tag to Repository

  • Create one ssh-key at server (user web)
  ssh-keygen -t ed25519 -C "your_email@example.com"
  • Add the key to the agent ssh. (not the .pub)
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/<key-created>
  • Copy the pub key
cat ~/.ssh/<key-created>.pub

Local Configs to Deploy

  • Creating one remote at your machine to deploy.
git remote add deploy ssh://web@dropletserver:22/home/app/code/magento.git

Deploy Command

  • The command to deploy. (we will use the master to deploy)
git push deploy master

Git Flow

Git Flow

Flow

MTFT

To do

Selenium

To do

Frontend

To do

Debug

To do

CI

To do

*using the docker from - markoshust/magento-nginx

About

Used to improve the knowledge at magento.

Resources

License

OSL-3.0 and 2 other licenses found

Licenses found

OSL-3.0
LICENSE.txt
Unknown
COPYING.txt
AFL-3.0
LICENSE_AFL.txt

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors