spatie / wordpress-ray

Debug with Ray to fix problems faster in WordPress apps
https://myray.app
MIT License
74 stars 14 forks source link

Unable to use in wordpress +docker container #71

Closed emanuellopes closed 1 year ago

emanuellopes commented 1 year ago

Hi all, I'm trying to use ray with wordpress running inside a docker-compose.yml file.

I've followed the documentation installed the wordpress plugin and tried also with spatie/ray package on my wordpress theme, but I'm unable to connect to application.

I tested a retested this a lot of times but with no success.

I don't know if I'm missing something on my configuration, also I don't know were I should put the ray.php config file.

I did some debug on spatie/ray but the config folder is always null or empty, the documentation are not good for this.

version: '3.4'
services:
  php:
    container_name: "wordpress"
    build:
      context: .
      dockerfile: 'Dockerfile'
      target: php
    user: "1001"
    expose:
        - "23517"
    extra_hosts: # <-- does no harm
        - "host.docker.internal:host-gateway" # <-- does no harm
    volumes:
      - static_files:/app/public/static:rw
      - ./theme:/app/public/static/wp-content/themes/theme
  nginx:
    image: nginx:stable
    user: "1001"
    depends_on:
      - php
    environment:
      PHP_SERVER_HOST: php
    ports:
      - "8888:8080"
    expose:
        - "23517"
    extra_hosts: # <-- does no harm
        - "host.docker.internal:host-gateway" # <-- does no harm
    volumes:
      - static_files:/app/public/static:rw
      - ./theme:/app/public/static/wp-content/themes/theme
volumes:
  static_files: {}
jeffreyvr commented 1 year ago

I haven't yet used Ray with Docker myself, but have you specified the host / port? More on that here:

https://spatie.be/docs/ray/v1/environment-specific-configuration/docker

You can put the ray.php config file in the root of your WordPress site.

emanuellopes commented 1 year ago

I put the ray.php file in wordpress root and worked well, but 10 logs is not enough for testing the application.

jeffreyvr commented 1 year ago

Logging is limited in the free/demo version I believe. You can purchase a license here: https://spatie.be/products/ray

I personally think it's worth every penny (and I'm not affiliated with Spatie ;-)).