Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Chron's avatar
Level 6

Error installing latest Laravel in Docker

Here's the docker-compose.yml

version: "3.8"

services:
  nginx:
    image: nginx:stable-alpine
    container_name: nginx
    depends_on:
      - mysql
    volumes: 
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
      - ./src:/var/www/html:delegated
    ports: 
      - "80:80"
  mysql:
    image: mysql
    restart: unless-stopped
    tty: true
    container_name: mysql
    volumes: 
      - ./mysql/data:/var/lib/mysql
    ports: 
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: root
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: phpmyadmin
    ports:
      - "4200:80"
    depends_on:
      - mysql
  php:
    build:
      context: ./dockerfiles
      dockerfile: php.dockerfile
    container_name: test
    working_dir: /var/www/html
    volumes: 
      - ./src:/var/www/html
    ports:
      - "9000:9000"
  composer:
    image: composer:latest
    container_name: composer
    working_dir: /var/www/html
    entrypoint: ['composer', '--ignore-platform-reqs']
    depends_on:
      - php
    volumes:
      - ./src:/var/www/html
  npm:
    image: node:latest
    container_name: npm
    working_dir: /var/www/html
    entrypoint: ['npm', '--no-bin-links']
    volumes:
      - ./src:/var/www/html

php.dockerfile

FROM php:8.1-fpm-alpine

RUN docker-php-ext-install pdo pdo_mysql
RUN docker-php-ext-configure gd --with-jpeg --with-webp --with-freetype
RUN docker-php-ext-install gd

This is the error I'm getting when I do docker compose run --rm composer create-project laravel/laravel .:

...
  - Installing spatie/flare-client-php (1.4.2): Extracting archive
  - Installing spatie/ignition (1.11.2): Extracting archive
  - Installing spatie/laravel-ignition (2.3.0): Extracting archive
  47/110 [===========>----------------]  42%    Install of fakerphp/faker failed
    Install of voku/portable-ascii failed
    Install of egulias/email-validator failed
    Install of symfony/http-kernel failed
    Install of ramsey/uuid failed
    Install of nunomaduro/termwind failed
The following exception is caused by a process timeout
Check https://getcomposer.org/doc/06-config.md#process-timeout for details

In Process.php line 1204:
                                                                                                                                                                
  The process "'/usr/bin/unzip' -qq '/var/www/html/vendor/composer/tmp-2cdef6a180fb83ec34f4174b57575450.zip' -d '/var/www/html/vendor/composer/b4415bc0'" exceeded the timeout of 300 seconds.                                                                                                                             
                                                                                                                                                                

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--ask] [--] [<package> [<directory> [<version>]]]
0 likes
1 reply
mehrancodes's avatar

Could you check with docker compose run --rm composer -vvv create-project laravel/laravel . to see where the composer loads the packages from?

Please or to participate in this conversation.