0

I have setup my wercker.yml file with the following step midway:

- script:
    name: Serve application
    code: php -S localhost:8000 >> /dev/null &

That appears to run, however, in another step when I try cURL to http://localhost:8000 I get the following:

curl: (7) Failed to connect to localhost port 8000: Connection refused

It does it for all ports, not just 8000. Has anyone else managed to get PHP's in built server working in wercker, or open any ports?

1 Answers1

0

Assuming you're using the wercker CLI and trying to set up a development pipeline, you need to use wercker dev with the --publish 8000 argument. This will forward the traffic from your host on port 8000 to the container on port 8000.

Also, if you're using boot2docker, you can't specify localhost, since boot2docker spins up a VM that runs docker. In that case you'll need to use your boot2docker IP, which you can find by running the boot2docker ip command.

Tonnu
  • 1
  • 1
  • Thanks Tonnu, not actually tried that in the CLI environment. I am using the wercker web app which is linked to my BitBucket account and running the tests on each commit. Was hoping to get the localhost port to open on the web app for our automated tests. Not sure if that's possible? – Mike Salmon Aug 21 '15 at 13:10