Skip to content

opsway/m2-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magento 2 docker stack

It is universal docker stack for running magento 2. There are source files for php, nginx, varnish. Also few examples for running different variants of magento 2.

php

you can use next env var for php image NEWRELIC_LICENSE - license key for new relic agent
NEWRELIC_APPNAME - new relic application name (for displaing in new relic dashbourd )
XDEBUG - enable xdebug ( set "YES" )
XDEBUG_REMOTE_PORT - port which your IDE listen for xdebug (default 9001)
XDEBUG_REMOTE_HOST - IDE IP. ( see XDEBUG section )
XDEBUG_REMOTE_AUTOSTART
SSH_SERVER - enable SSH_SERVER in php container
DEV_ENV - set dev mode fot php
COMPOSER_USERNAME - user name and password for auth.json
COMPOSER_PASSWORD

XDEBUG

local usage
you need set next env vars
XDEBUG="yes"
XDEBUG_REMOTE_HOST - set IP local address, ( e.g. 192.168.0.10 )
XDEBUG_REMOTE_AUTOSTART="yes"

remote usage
first of all you have to set up SSH for php. Than enable xdebug by adding env var XDEBUG="yes". Last step setup tunnel
ssh -R localhost:9001:localhost:9001 www-data@%REMOTE_SERVER% -p %PORT%

SSH

you can use SSH for connecting to container:

  • SSH_SERVER="yes"
  • PROMT_MESSAGE="project-name" - promt message via ssh session.
  • add volume with files contains ssh open keys authorized_keys:/home/www-data/.ssh/authorized_keys
  • set port mapping - 2222:22

ssh -p 2222 www-data@SERVER_IP

cron

for running crond I have to just run php container with next params

  • entrypoint /sbin/tini
  • command /entrypoint.sh /usr/sbin/crond -f -L /dev/stdout

nginx

DOC_ROOT nginx document root param (default /app/current)
UPSTREAM upstream for php-fpm (default app)

varnish

STORAGE ( file | malloc ) default=malloc
STORAGE_SIZE default=2G EXTRA_PARAMS extra varnish params. E.g. "-p default_ttl=86400"