I am trying to access the http://localhost/ or http://127.0.0.1 from inside the docker container itself. I can ping localhost when I am inside the running container:
$ sudo docker exec -i -t 045ff7f4755b /bin/bash
$ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.108 ms
But, I get an error when I try
$ curl 127.0.0.1/api.php
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
Here is my dockerfile:
FROM php:7.1.0-apache
RUN pecl install xdebug-2.5.0 \
&& docker-php-ext-enable xdebug
RUN mkdir /opt/framework
COPY . /opt/framework
COPY . /var/www/html/
WORKDIR /opt/framework
ENTRYPOINT ["docker-php-entrypoint"]
The endgame here, is to be able to run codeception (an acceptance tester) inside that container and for everything to be contained inside that container. I am also open to the idea that I may be approaching this entirely wrong. I am new to docker, and am not sure the best way to get my desired result.