I'm working with Docker containers for a while know, but I do not notice, what I am doing wrong here:
In my current folder on the host system, I have a simple index.php
file which contains:
<?php echo 'hi'; ?>
Why is this not working?
docker run --name php -v $(pwd):/app -w /app -p 8080:8080 -d --rm php:cli php -S localhost:8080 -t . index.php
This results in an empty reply:
$ curl localhost:8080
curl: (52) Empty reply from server
If I exec
in the container and apply the curl
there it succeeds in replying hi
.
So, what am I missing?