title: Class not found in autoload.php on line 14 on some docker hosts
body: <p>I try to create dockerfile for laravel 5.5 application and nginx. I use similar to following dockerfile:</p>
  
  <pre class="lang-bash prettyprint-override"><code>FROM richarvey/nginx-php-fpm:1.3.7
  
  # we cannot directly work in /var/www/html beaouse in richarvey/nginx-php-fpm is VOLUME directive so if we create
  # files in this directory - they will 'disappear' - so we use /tmp dir. 
  WORKDIR /tmp/project
  
  # due to docker cache
  COPY ./composer.json .
  RUN composer install --no-scripts --no-autoloader
  
  ADD . .
  RUN composer dump-autoload --optimize
  RUN php artisan key:generate
  
  ADD ./config/server-nginx.conf /etc/nginx/sites-available/default.conf
  
  WORKDIR /var/www/html
  
  CMD if [ -f index.php ]; then \
          rm index.php &amp;&amp;\            
          mv /tmp/project/* /var/www/html/ &amp;&amp; \
          mv /tmp/project/.* /var/www/html/ | : &amp;&amp;\
          php artisan config:clear &amp;&amp;\
          php artisan cache:clear ; \
      fi &amp;&amp;\
      echo "Try connect to db and set up schema..." &amp;&amp; \
      php artisan migrate --seed --force &amp;&amp;\
      /start.sh
  </code></pre>
  
  <p>My project/config/server-nginx.conf looks like that:</p>
  
  <pre><code>server {
      listen   80; ## listen for ipv4; this line is default and implied
      listen   [::]:80 default ipv6only=on; ## listen for ipv6
  
  
      root /var/www/html/public;
      index index.php index.html index.htm;
  
      server_name _;
  
      # Add stdout logging
      error_log /dev/stdout info;
      access_log /dev/stdout;
  
  
      location / {
          try_files $uri $uri/ /index.php?$query_string;
      }
  
      location ~ \.php$ {
          try_files $uri /index.php =404;
          fastcgi_split_path_info ^(.+\.php)(/.+)$;
          fastcgi_pass unix:/var/run/php-fpm.sock;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          fastcgi_param SCRIPT_NAME $fastcgi_script_name;
          include fastcgi_params; 
  
          ...            
      }
  
  }
  </code></pre>
  
  <p>The problem is that everything works fine in my macOs and ubuntu, however my client which use Docker Claud and DigitalOcean have following problem after container run (so building step is fine, but after container run it is killed by docker - so in CMD dockerfile part):</p>
  
  <pre><code>Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in /var/www/html/vendor/autoload.php:14
  Stack trace:
  #0 /var/www/html/artisan(18): require()
  </code></pre>