wodby / docker4drupal

Docker-based Drupal stack
https://wodby.com/docker4drupal
MIT License
1.24k stars 535 forks source link

Any way to not install Xdebug? #464

Open liquidcms opened 3 years ago

liquidcms commented 3 years ago

Codebase mounted codebase ??

Describe your issue Is it possible to have container not install Xdebug. I have tried setting PHP_XDEBUG = 0 but this has no impact (phpinfo still lists xdebug).

Output of docker info Client: Debug Mode: false

Server: Containers: 9 Running: 8 Paused: 0 Stopped: 1 Images: 9 Server Version: 19.03.8 Storage Driver: overlay2 Backing Filesystem: Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: runc version: init version: Security Options: apparmor seccomp Profile: default Kernel Version: 5.4.0-58-generic Operating System: Ubuntu 20.04.1 LTS OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 9.732GiB Name: user-ubuntu ID: YATS:ZBGS:FFFS:DMBN:HQXC:QUIV:Q37Y:VLDU:OAXM:PEJ5:ONHZ:LJZ6 Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

WARNING: No swap limit support

Contents of your docker-compose.yml version: "3"

services: mariadb: image: wodby/mariadb:$MARIADB_TAG container_name: "${PROJECT_NAME}_mariadb" stop_grace_period: 30s environment: MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD MYSQL_DATABASE: $DB_NAME MYSQL_USER: $DB_USER MYSQL_PASSWORD: $DB_PASSWORD volumes:

- ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.

  - ./mariadb/data:/var/lib/mysql # Use bind mount

php: image: wodby/drupal-php:$PHP_TAG container_name: "${PROJECT_NAME}_php"

Indexes solr after startup so that it does not have to be done manually.

command: bash -c "sudo -E LD_PRELOAD=/usr/lib/preloadable_libiconv.so php-fpm -D && drush search-api-solr:finalize-index --force && drush search-api-reindex && drush search-api-index && while true; do sleep 1000; done"
depends_on:
  - solr
environment:
  PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025

PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S opensmtpd:25

  DB_HOST: $DB_HOST
  DB_USER: $DB_USER
  DB_PASSWORD: $DB_PASSWORD
  DB_NAME: $DB_NAME
  DB_DRIVER: $DB_DRIVER
  PHP_FPM_USER: wodby
  PHP_FPM_GROUP: wodby
  COLUMNS: 80 # Set 80 columns for docker exec -it.

Read instructions at https://wodby.com/docs/stacks/php/local/#xdebug

  PHP_XDEBUG: 0
  PHP_XDEBUG_DEFAULT_ENABLE: 0
  PHP_XDEBUG_REMOTE_CONNECT_BACK: 0

PHP_IDE_CONFIG: serverName=my-ide

PHP_XDEBUG_IDEKEY: "my-ide"

PHP_XDEBUG_REMOTE_HOST: host.docker.internal # Docker 18.03+ Mac/Win

  PHP_XDEBUG_REMOTE_HOST: 172.17.0.1 # Linux

PHP_XDEBUG_REMOTE_HOST: 10.254.254.254 # macOS, Docker < 18.03

PHP_XDEBUG_REMOTE_HOST: 10.0.75.1 # Windows, Docker < 18.03

  PHP_XDEBUG_REMOTE_LOG: /tmp/php-xdebug.log
volumes:
  - ../:/var/www/html:cached

For macOS users (https://wodby.com/docs/stacks/drupal/local#docker-for-mac)

- ./:/var/www/html:cached # User-guided caching

- docker-sync:/var/www/html # Docker-sync

For XHProf and Xdebug profiler traces

- files:/mnt/files

nginx: image: wodby/nginx:$NGINX_TAG container_name: "${PROJECT_NAME}_nginx" depends_on:

postgres:

image: wodby/postgres:$POSTGRES_TAG

container_name: "${PROJECT_NAME}_postgres"

stop_grace_period: 30s

environment:

POSTGRES_PASSWORD: $DB_PASSWORD

POSTGRES_DB: $DB_NAME

POSTGRES_USER: $DB_USER

volumes:

- ./postgres-init:/docker-entrypoint-initdb.d # Place init file(s) here.

- /path/to/postgres/data/on/host:/var/lib/postgresql/data # Use bind mount

apache:

image: wodby/apache:$APACHE_TAG

container_name: "${PROJECT_NAME}_apache"

depends_on:

- php

environment:

APACHE_LOG_LEVEL: debug

APACHE_BACKEND_HOST: php

APACHE_VHOST_PRESET: php

APACHE_DOCUMENT_ROOT: /var/www/html/web

volumes:

- ./:/var/www/html

For macOS users (https://wodby.com/docs/stacks/drupal/local#docker-for-mac)

- ./:/var/www/html:cached # User-guided caching

- docker-sync:/var/www/html # Docker-sync

labels:

- "traefik.http.routers.${PROJECT_NAME}_apache.rule=Host(${PROJECT_BASE_URL})"

varnish:

image: wodby/varnish:$VARNISH_TAG

container_name: "${PROJECT_NAME}_varnish"

depends_on:

- nginx

environment:

VARNISH_SECRET: secret

VARNISH_BACKEND_HOST: nginx

VARNISH_BACKEND_PORT: 80

VARNISH_CONFIG_PRESET: drupal

VARNISH_ALLOW_UNRESTRICTED_PURGE: 1

labels:

- "traefik.http.services.${PROJECT_NAME}_varnish.loadbalancer.server.port=6081"

- "traefik.http.routers.${PROJECT_NAME}_varnish.rule=Host(varnish.${PROJECT_BASE_URL})"

redis:

container_name: "${PROJECT_NAME}_redis"

image: wodby/redis:$REDIS_TAG

adminer:

container_name: "${PROJECT_NAME}_adminer"

image: wodby/adminer:$ADMINER_TAG

environment:

For PostgreSQL:

ADMINER_DEFAULT_DB_DRIVER: pgsql

ADMINER_DEFAULT_DB_HOST: $DB_HOST

ADMINER_DEFAULT_DB_NAME: $DB_NAME

labels:

- "traefik.http.routers.${PROJECT_NAME}_adminer.rule=Host(adminer.${PROJECT_BASE_URL})"

pma: image: phpmyadmin/phpmyadmin container_name: "${PROJECT_NAME}_pma" environment: PMA_HOST: $DB_HOST PMA_USER: $DB_USER PMA_PASSWORD: $DB_PASSWORD PHP_UPLOAD_MAX_FILESIZE: 1G PHP_MAX_INPUT_VARS: 1G labels:

drupal-node:

image: wodby/drupal-node:$DRUPAL_NODE_TAG

container_name: "${PROJECT_NAME}_drupal_nodejs"

environment:

NODE_SERVICE_KEY: node-service-key

labels:

- "traefik.http.routers.${PROJECT_NAME}_drupal_node.rule=Host(drupal_node.${PROJECT_BASE_URL})"

volumes:

- ./path/to/your/single-page-app:/app

command: sh -c 'npm install && npm run start'

memcached:

container_name: "${PROJECT_NAME}_memcached"

image: wodby/memcached:$MEMCACHED_TAG

rsyslog:

container_name: "${PROJECT_NAME}_rsyslog"

image: wodby/rsyslog:$RSYSLOG_TAG

athenapdf:

image: arachnysdocker/athenapdf-service:$ATHENAPDF_TAG

container_name: "${PROJECT_NAME}_athenapdf"

environment:

WEAVER_AUTH_KEY: weaver-auth-key

WEAVER_ATHENA_CMD: "athenapdf -S"

WEAVER_MAX_WORKERS: 10

WEAVER_MAX_CONVERSION_QUEUE: 50

WEAVER_WORKER_TIMEOUT: 90

WEAVER_CONVERSION_FALLBACK: "false"

node:

image: wodby/node:$NODE_TAG

container_name: "${PROJECT_NAME}_node"

working_dir: /var/www/html/path/to/theme/to/build

labels:

- "traefik.http.services.${PROJECT_NAME}_node.loadbalancer.server.port=3000"

- "traefik.http.routers.${PROJECT_NAME}_node.rule=Host(node.${PROJECT_BASE_URL})"

expose:

- "3000"

volumes:

- ./:/var/www/html

command: sh -c 'yarn install && yarn run start'

blackfire:

image: blackfire/blackfire

container_name: "${PROJECT_NAME}_blackfire"

environment:

BLACKFIRE_SERVER_ID: XXXXX

BLACKFIRE_SERVER_TOKEN: YYYYY

webgrind:

image: wodby/webgrind:$WEBGRIND_TAG

container_name: "${PROJECT_NAME}_webgrind"

environment:

WEBGRIND_PROFILER_DIR: /mnt/files/xdebug/profiler

labels:

- "traefik.http.routers.${PROJECT_NAME}_webgrind.rule=Host(webgrind.${PROJECT_BASE_URL})"

volumes:

- files:/mnt/files

elasticsearch:

image: wodby/elasticsearch:$ELASTICSEARCH_TAG

environment:

ES_JAVA_OPTS: "-Xms500m -Xmx500m"

ulimits:

memlock:

soft: -1

hard: -1

kibana:

image: wodby/kibana:$KIBANA_TAG

depends_on:

- elasticsearch

labels:

- "traefik.http.services.${PROJECT_NAME}_kibana.loadbalancer.server.port=5601"

- "traefik.http.routers.${PROJECT_NAME}_kibana.rule=Host(kibana.${PROJECT_BASE_URL})"

opensmtpd:

container_name: "${PROJECT_NAME}_opensmtpd"

image: wodby/opensmtpd:$OPENSMTPD_TAG

xhprof:

image: wodby/xhprof:$XHPROF_TAG

restart: always

volumes:

- files:/mnt/files

labels:

- "traefik.http.routers.${PROJECT_NAME}_xhprof.rule=Host(xhprof.${PROJECT_BASE_URL})"

portainer: image: portainer/portainer container_name: "${PROJECT_NAME}_portainer" command: --no-auth -H unix:///var/run/docker.sock volumes:

volumes:

Docker-sync for macOS users

docker-sync:

external: true

For Xdebug profiler

files:

Contents of your .env SHELL=/bin/bash SESSION_MANAGER=local/user-ubuntu:@/tmp/.ICE-unix/2574,unix/user-ubuntu:/tmp/.ICE-unix/2574 QT_ACCESSIBILITY=1 COLORTERM=truecolor XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg XDG_MENU_PREFIX=gnome- GNOME_DESKTOP_SESSION_ID=this-is-deprecated GTK_IM_MODULE=ibus LANGUAGE=en_CA:en QT4_IM_MODULE=ibus GNOME_SHELL_SESSION_MODE=ubuntu SSH_AUTH_SOCK=/run/user/1000/keyring/ssh XMODIFIERS=@im=ibus DESKTOP_SESSION=ubuntu SSH_AGENT_PID=2415 GTK_MODULES=gail:atk-bridge PWD=/home/user/Projects/eps_profile/docker LOGNAME=user XDG_SESSION_DESKTOP=ubuntu XDG_SESSION_TYPE=x11 GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1 XAUTHORITY=/run/user/1000/gdm/Xauthority GJS_DEBUG_TOPICS=JS ERROR;JS LOG WINDOWPATH=2 HOME=/home/user USERNAME=user IM_CONFIG_PHASE=1 LANG=en_CA.UTF-8 LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:*.xspf=00;36: XDG_CURRENT_DESKTOP=ubuntu:GNOME VTE_VERSION=6003 GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/848e5d64_edc3_40b7_98e9_08f6e7167afd INVOCATION_ID=436e180a44c843aebfb1c7e1ff50a016 MANAGERPID=2198 CLUTTER_IM_MODULE=ibus GJS_DEBUG_OUTPUT=stderr LESSCLOSE=/usr/bin/lesspipe %s %s XDG_SESSION_CLASS=user TERM=xterm-256color LESSOPEN=| /usr/bin/lesspipe %s USER=user GNOME_TERMINAL_SERVICE=:1.145 DISPLAY=:0 SHLVL=1 QT_IM_MODULE=ibus XDG_RUNTIME_DIR=/run/user/1000 JOURNAL_STREAM=9:36621 XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin GDMSESSION=ubuntu DBUS_SESSION_BUSADDRESS=unix:path=/run/user/1000/bus OLDPWD=/home/user =/usr/bin/env

Logs output docker-compose logs n/a

liquidcms commented 3 years ago

and as usual.. 2 minutes after posting; figured it out. It isn't good enough to set PHP_XDEBUG = 0; you have to comment that line out.