title: Can't access my Laravel project through Apache in Docker - /var/www/ directory is empty
body: <p>So I built a Docker image of a Laravel project I'm working on, but when I run the containers (with docker-compose up), I can't access the application.</p>
  
  <p>I'm currently using Docker Toolbox for Windows, so I use the IP from the docker-machine, but all I get is "The requested URL / was not found on this server." (404).</p>
  
  <p>In the Docker Terminal, I get the following warnings:</p>
  
  <pre><code>php-apache_1  | AH00112: Warning: DocumentRoot [/var/www/html] does not exist
  php-apache_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
  
  php-apache_1  | [Fri Mar 15 14:04:10.964296 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
  </code></pre>
  
  <p>I navigated through the directories inside the container (with docker exec -it) and, indeed, the /var/www/html directory doesn't exist, once the /var/www directory is empty, <strong>but it shouldn't be</strong>!!</p>
  
  <p>In the php-apache.dockerfile I copied all my project to the /var/www directory, so it shouldn't be empty.</p>
  
  <p>I've been trying to solve this for a while now, so if anyone could help me I would really appreciate it.</p>
  
  <p>Here is the php-apache.dockerfile:</p>
  
  <pre><code>FROM php:7.2.9-apache-stretch
  
  RUN apt-get update &amp;&amp; apt-get install -y libxml2-dev &amp;&amp; apt-get install -y 
  libcurl3-dev
  RUN docker-php-ext-install pdo_mysql mbstring tokenizer xml ctype json
  
  RUN mkdir storage &amp;&amp;\
      mkdir storage/logs &amp;&amp;\
      mkdir storage/app &amp;&amp;\
      mkdir storage/framework &amp;&amp;\
      mkdir storage/framework/cache &amp;&amp;\
      mkdir storage/framework/sessions &amp;&amp;\
      mkdir storage/framework/views &amp;&amp;\
      mkdir -p bootstrap/cache
  
  COPY composer.json composer.lock /var/www/
  
  WORKDIR /var/www
  
  COPY . /var/www
  
  RUN curl --silent https://getcomposer.org/installer | php &amp;&amp;\
      composer install
  
  COPY public /var/www/html
  
  RUN chown -R www-data:www-data \
      /var/www/storage \
      /var/www/bootstrap/cache
  
  RUN a2enmod rewrite
  
  EXPOSE 80
  </code></pre>
  
  <p>And the docker-compose.yml:   </p>
  
  <pre><code>version: '3'
  services:
    db:
      image: mysql:latest
      environment:
        - MYSQL_USER=root
        - MYSQL_ROOT_PASSWORD=
        - MYSQL_DATABASE=ontologyFramework
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes
      ports:
        - "3306:3306"   
  
    php-apache:
      depends_on:
        - db
      build:
        dockerfile: phpapache.dockerfile
        context: .
      volumes:
        - ./:/var/www
      ports:
        - "80:80"
      environment:
        - DB_PORT=3306
        - DB_HOST=127.0.0.1
      links:
        - db
  </code></pre>