swoole / docker-swoole

🏄 Official Docker Image of Swoole
https://hub.docker.com/r/phpswoole/swoole
Apache License 2.0
534 stars 113 forks source link

using Yasd widh curl or requests form browser / PHPStorm #30

Closed Cluster2a closed 2 years ago

Cluster2a commented 2 years ago

Hey, I am using a dockerized environment with:

  1. laravel octan (swoole)
  2. nginx to soole
  3. traefik for reverse proxy

I am able to use Yasd with the following settings:

[yasd]
yasd.debug_mode=remote
yasd.remote_host=172.17.0.1
yasd.remote_port=9000

If I run php -e test.ph in the container PHPStorm is hitting the break points.

As written in https://github.com/swoole/docker-swoole/tree/master/examples/35-debug-with-yasd I should be able to debug curl requests and browser requests from outside the container.

I started the entire server with the e-flag:

php -e artisan octane:start --server="swoole" --host="0.0.0.0" --workers=auto --task-workers=auto --max-requests=500

Is there anything else I need to do, to debug requests?

edit: Even after accessing the container directly (without trafik / nginx) it is not possible to call the debugger via curl:

swoole-dev:
    build:
        context: ./devOps/api/docker/dev/swoole/
        dockerfile: Dockerfile
    environment:
        PHP_IDE_CONFIG: "serverName=myServer"
        SHELL: /bin/sh
    ports:
        - "80:80"
    volumes:
        - ./app/api:/app
        - ./devOps/api/docker/dev/swoole/conf/custom.ini:/usr/local/etc/php/conf.d/custom.ini
    env_file:
        - ./devOps/api/docker/dev/etc/environment.env
    logging:
        driver: "json-file"
        options:
            max-size: "5m"
liulyn commented 2 years ago

邮件已收到 谢谢!