Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-6017

Composer permission error after container re-creation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Should have Should have
    • 2.52.1
    • None

      Composer permission to 'app' user are lost when containers are removed and re-created. This happens at any time docker uses docker-compose down && docker-compose up commands. (Might happen automatically when some systems are shutdown)

      > make dev
      > docker-compose exec -u app php-fpm composer licenses
      // display packages licenses
      > make down && make up
      > docker-compose exec -u app php-fpm composer licenses
      // fails
      bash: /app/bin/composer: Permission denied
      

      WordPress container (php-fpm) can't run with user 'app', it runs with root (this constraint comes from the usage of phusion-baseimage). Every time we re-create a container, it mounts its files as root, and runs scripts in /etc/my_init.d. When it runs 20_install_wordpress.sh, it detects a wordpress installation and so skips all permissions fixes usually executed on first run.
      'app' user is created after composer install (php_install_composer executed in php-fpm Dockerfile, add_user executed in entrypoint) , so we can't solve this before entrypoint.

      Tasks:

      • Run composer permissions fixes before wordpress installation check

            fhernand Florent Hernandez (Inactive)
            fhernand Florent Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: