From cc3d88a3e93bfccab54f93f677bfa6581cfc7fba Mon Sep 17 00:00:00 2001 From: Andrew Berry Date: Mon, 6 Nov 2023 12:01:37 +0900 Subject: [PATCH] Fix installation, startup, and other first-run errors --- README.md | 2 +- docker-compose.xhgui.yaml | 13 +++++++++---- install.yaml | 5 +++-- xhgui-mongo/mongo.init.d | 1 + xhgui/Dockerfile | 3 +++ xhgui/examples/xhgui.collector.config.php | 1 + xhgui/examples/xhgui.collector.php | 1 + xhprof/xhprof_prepend.php | 5 +++++ 8 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 xhgui/Dockerfile create mode 100644 xhprof/xhprof_prepend.php diff --git a/README.md b/README.md index b7c6656..256196a 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Take into account that with the default configuration, every time you `ddev star The service will automatically start when run: `ddev start` or `ddev restart`. -By default, xhgui will be available at ``:8282. Note that it's http only. +By default, xhgui will be available at ``:8143. Remember, if you updated `settings.ddev.php` or `wp-config-ddev.php`, these file will be overwritten unless you remove the `#ddev-generated`. diff --git a/docker-compose.xhgui.yaml b/docker-compose.xhgui.yaml index 7b22370..68ab47e 100644 --- a/docker-compose.xhgui.yaml +++ b/docker-compose.xhgui.yaml @@ -2,7 +2,9 @@ services: xhgui: # https://hub.docker.com/r/xhgui/xhgui/tags - image: xhgui/xhgui:latest + build: + dockerfile: Dockerfile + context: xhgui container_name: ddev-${DDEV_SITENAME}-xhgui labels: com.ddev.site-name: ${DDEV_SITENAME} @@ -12,12 +14,15 @@ services: - ./xhgui/nginx.conf:/etc/nginx/http.d/default.conf:ro - ./xhgui/xhgui.config.php:/var/www/xhgui/config/config.php environment: + - VIRTUAL_HOST=$DDEV_HOSTNAME + - HTTP_EXPOSE=8142:80 + - HTTPS_EXPOSE=8143:80 - XHGUI_MONGO_HOSTNAME=xhgui-mongo - XHGUI_MONGO_DATABASE=xhprof - ports: - - "8142:80" links: - xhgui-mongo + depends_on: + - xhgui-mongo web: links: @@ -27,7 +32,7 @@ services: xhgui-mongo: # https://hub.docker.com/r/percona/percona-server-mongodb/tags - image: percona/percona-server-mongodb:3.6 + image: percona/percona-server-mongodb:6.0-multi container_name: ddev-${DDEV_SITENAME}-xhgui-mongo command: --storageEngine=wiredTiger restart: always diff --git a/install.yaml b/install.yaml index 82fafc8..8cb799c 100644 --- a/install.yaml +++ b/install.yaml @@ -57,8 +57,9 @@ pre_install_actions: # DDEV environment variables can be interpolated into these filenames project_files: - docker-compose.xhgui.yaml -- xhgui/config.default.php +- xhgui/Dockerfile +- xhgui/xhgui.config.php - xhgui/examples/xhgui.collector.config.php - xhgui/examples/xhgui.collector.php - xhgui/nginx.conf -- xhgui-mongo/xhgui.js +- xhprof/xhprof_prepend.php diff --git a/xhgui-mongo/mongo.init.d b/xhgui-mongo/mongo.init.d index c386fca..7f2f250 100644 --- a/xhgui-mongo/mongo.init.d +++ b/xhgui-mongo/mongo.init.d @@ -1,3 +1,4 @@ +#ddev-generated db.results.ensureIndex( { 'meta.SERVER.REQUEST_TIME' : -1 } ); db.results.ensureIndex( { 'profile.main().wt' : -1 } ); db.results.ensureIndex( { 'profile.main().mu' : -1 } ); diff --git a/xhgui/Dockerfile b/xhgui/Dockerfile new file mode 100644 index 0000000..3f5baa5 --- /dev/null +++ b/xhgui/Dockerfile @@ -0,0 +1,3 @@ +FROM xhgui/xhgui:latest + +RUN echo 'memory_limit=512M' >> $PHP_INI_DIR/conf.d/99-memory-limit.ini diff --git a/xhgui/examples/xhgui.collector.config.php b/xhgui/examples/xhgui.collector.config.php index 7540f42..0efddaa 100644 --- a/xhgui/examples/xhgui.collector.config.php +++ b/xhgui/examples/xhgui.collector.config.php @@ -1,4 +1,5 @@