EasyEngine/admin-tools-command

Fix ee-admin directory location to /var/www/htdocs

dhsathiya opened this issue · 1 comments

EE has --public-dir=dir_name option to change public dir to a custom location inside /var/www/htdocs, which is mainly helpful in CI/CD.

When we enable admin-tools, a directory named ee-admin gets created inside public dir.
When new code gets deployed, ee-admin directory gets removed due to the deployment pipeline might not have ee-admin dir and due to which ee-admin stops working.

To fix this, we can create ee-admin directory in /var/www/htocs/ instead of public dir.


Solution
File name: docker-compose-admin.yml

version: '3.5'

services:

  php:
    environment:
      - REDIS_HOST=
      - DB_HOST=global-db
    volumes:
      - "/opt/easyengine/admin-tools:/var/www/htdocs/ee-admin:ro"
      - "/opt/easyengine/db/ee.sqlite:/opt/easyengine/db/ee.sqlite:ro"

  nginx:
    volumes:
      - "/opt/easyengine/admin-tools:/var/www/htdocs/ee-admin:ro"
      - "/opt/easyengine/db/ee.sqlite:/opt/easyengine/db/ee.sqlite:ro"

File name: nginx/conf.d/main.conf

location ^~ /ee-admin/ {
	root /var/www/htdocs ;
	location ~ \.php$ {
		try_files $uri =404;
		include fastcgi_params;
		fastcgi_pass php;
	}
}

PR for
Path change: #46
Nginx config (site-type=php): EasyEngine/site-type-php#76
Nginx config (site-type=wp):EasyEngine/site-type-wp#173