Skip to content

[Bug]: Composer cache directory is created in project root and not gitignored #270

Description

@kanevbg

Expected behavior

The default skeleton setup should not leave Composer runtime/cache artifacts as untracked project files.

Either /cache/ should be included in the default .gitignore, or the default Docker Composer configuration should use a Composer home/cache path outside the project root.

With the current docker-compose.yaml setting COMPOSER_HOME=/var/www/html, the expected behavior is that the resulting /cache/ directory is ignored by Git by default.

Actual behavior

pimcore/skeleton v2026.1.2 sets COMPOSER_HOME to /var/www/html in docker-compose.yaml.

Because of that, when Composer is run inside the php container, Composer uses /var/www/html/cache as its default cache directory. Since /var/www/html is the project root mount, this creates a project-root /cache directory.

The generated /cache directory is not ignored by the skeleton .gitignore, so it appears as an untracked Git directory.

Steps to reproduce

  1. Create a new project from pimcore/skeleton v2026.1.2:
    composer create-project pimcore/skeleton --no-scripts my-project

  2. Go to the project:
    cd my-project

  3. Start the default Docker setup:
    docker compose up -d

  4. Run Composer inside the php container:
    docker compose exec -T php composer install

  5. Verify Composer's cache configuration:
    docker compose exec -T php composer config --list --source | grep -E 'home|cache-dir'

  6. Initialize Git, because a new create-project checkout is not necessarily a Git repository:
    git init

  7. Check Git status:
    git status --short

  8. Observe that /cache is created in the project root and appears as untracked.

The Git initialization step is only used to demonstrate that the generated /cache directory is not ignored by the default .gitignore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    Affected capability

    None yet

    Platform Version

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions