Docker exposing ports site can't be reached
<p>I have exposed the required ports in my dockerfiles as well mapped them in my <code>docker-compose.yml</code>.</p>

<p>If i create containers without a docker-compose.yml i can access everything, but if i use <code>docker-compose.yml</code> file i cannot access 2 out of 3 images via a <code>http-get</code> request.</p>

<p>But according to <code>docker port &lt;container-name&gt;</code> the ports are mapped:</p>

<p><strong>bitmovin@bitmovin-VirtualBox:~/Documents$ docker port php-container 8080:</strong></p>

<pre><code>0.0.0.0:8080
</code></pre>

<p><strong>bitmovin@bitmovin-VirtualBox:~/Documents$ docker port php-container:</strong></p>

<pre><code>8080/tcp -&gt; 0.0.0.0:8080
</code></pre>

<p><strong>bitmovin@bitmovin-VirtualBox:~/Documents$ docker port comp-container:</strong></p>

<pre><code>8080/tcp -&gt; 0.0.0.0:8070
</code></pre>

<p><strong>bitmovin@bitmovin-VirtualBox:~/Documents$ docker port phpmyadmin-container:</strong></p>

<pre><code>8080/tcp -&gt; 0.0.0.0:8090
</code></pre>

<p>I don't know why i cannot access the <code>phpmyadmin-container</code> and the <code>php-container</code> but the <code>comp-container</code> if i use a <code>docker-compose</code> file.</p>

<p>Did i miss something important?</p>

<p><strong>php-image:</strong></p>

<pre><code>FROM php:7.0-apache

EXPOSE 8080

COPY Frontend/ /var/www/html/aw3somevideo/
COPY Frontend/ /var/www/html/

RUN chown -R www-data:www-data /var/www/html 
RUN chmod -R 755 /var/www/html 

RUN docker-php-ext-install mysqli 
RUN php -i | grep -F .default_socket
</code></pre>

<p><strong>comp-image:</strong></p>

<pre><code>FROM java:openjdk-8u91-jdk
EXPOSE 8070
CMD java -jar encoding-comparison-1.0.jar
ADD encoding-comparison-1.0.jar  /encoding-comparison-1.0.jar
</code></pre>

<p><strong>phpmyadmin-image:</strong></p>

<pre><code>FROM phpmyadmin/phpmyadmin
EXPOSE 8090
</code></pre>

<p><strong>docker-compose.yml:</strong></p>

<pre><code>db:
    image: mysql-image
    ports:
     - "3306:3306"
    volumes:
     - /var/lib/mysql
    environment:
     - MYSQL_ROOT_PASSWORD=Bitmovin
     - DB_NAME=aw3somevideo
     - DB_USER=Bitmovin
     - DB_PASS=Bitmovin
    container_name: mysql-container

  admin:
    image: phpmyadmin-image
    ports:
      - "8090:8080"
    links:
      - db
    container_name: phpmyadmin-container

  backend:
    image: comp-image
    ports:
      - "8070:8080"
    volumes:
      - ./src:/var/www/backend
    links:
      - db
    container_name: comp-container

  php:
    image: php-image
    volumes:
      - ./src:/var/www/html
    links:
      - db
    ports:
      - "8080:8080"
    container_name: php-container
</code></pre>