trap
trap copied to clipboard
Add support for environment variables.
It would be good to have ability to use TRAP_* env variables to configure /vendor/bin/trap
For example:
TRAP_SENDERS=console,server
TRAP_DEBUG_PORTS=9912,xxxx,yyyy
TRAP_UI_PORT=8000
Which would simplify usage in docker, here is current example:
trap:
image: wayofdev/php-dev:8.3-cli-alpine-latest
container_name: ${COMPOSE_PROJECT_NAME}-trap
restart: on-failure
networks:
- default
ports:
- '${TRAP_PORT:-9912}:9912'
- '${TRAP_UI_PORT:-8000}:8000'
volumes:
- ./:/app:rw
- ~/.composer:/.composer
env_file:
- .env
entrypoint:
- /app/vendor/bin/trap
- --ui
- --port=${TRAP_PORT:-9912}
- --sender=server
- --sender=console
Also, currently, there is no way to customize UI port number. 8000 port is used by many other applications, and it would be nice, to be able to customize it via console command attributes and also via ENV variables.
TRAP_TCP_PORTS and TRAP_UI_PORT are implemented.