Created
July 30, 2025 13:05
-
-
Save wilcorrea/10ce5495a4410d23463ff31ed87993d2 to your computer and use it in GitHub Desktop.
dockerized php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ACTION="$1" | |
| case ${ACTION} in | |
| "stop") | |
| docker stop php-cli | |
| ;; | |
| "start") | |
| docker run --rm --name php-cli -i -t -d \ | |
| --workdir "$(pwd)" \ | |
| --volume "$(pwd):$(pwd)" \ | |
| --entrypoint /bin/sh \ | |
| --platform linux/amd64 \ | |
| devitools/hyperf:8.3-dev &>/dev/null | |
| ;; | |
| *) | |
| if [ -z "$(docker ps -a | grep php-cli)" ]; then | |
| echo "PHP is not running" | |
| echo " use: php up" | |
| exit 1 | |
| fi | |
| echo "$@" > /var/log/php/php.log | |
| docker exec php-cli php $@ | |
| ;; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment