title: How to install yarn and npm on a PHP docker image (symfony 4 project)
body: <p>Im working on a symfony 4/posgresql project. Im using docker toolbox.</p>
  <p>I need to install webpack encore bundle on symfony, but in order to do this, i need to add yarn and npm to my project. Somebody told me i should add theses 2 installations on my php docker container, but i don't know which command to add (im a linux/docker beginner).</p>
  <p>This is my docker-compose.yaml :</p>
  <pre><code> 
  services:
    database:
      image: postgres:11-alpine
      ports:
          - &quot;5432:5432&quot;
      volumes:
        - 'boeki_database:/var/lib/postgresql/data'
      environment:
        POSTGRES_PASSWORD: root
   
    database_pg_admin:
      image: dpage/pgadmin4
      ports:
          - &quot;8001:80&quot;
      environment:
        PGADMIN_DEFAULT_EMAIL: root@root.com
        PGADMIN_DEFAULT_PASSWORD: root
         
    application:
      build:
        context: .
        dockerfile: ./docker/Dockerfile
      working_dir: /var/www/project
      ports:
          - &quot;8000:80&quot;
      volumes:
        - ./:/var/www/project:rw,cached
        - ./docker/http/000-default.conf:/etc/apache2/sites-enabled/000-default.conf:rw,cached
   
  volumes:
    boeki_database: {} 
  
  </code></pre>
  <p>And this is my Dockerfile :</p>
  <pre><code> 
  RUN apt-get update &amp;&amp; \
      apt-get install -y libpq-dev g++ zlib1g-dev libicu-dev vim git zip
   
  #GD
  RUN apt-get update &amp;&amp; \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    libzip-dev \
    poppler-utils
   
  RUN rm -rf /var/lib/apt/lists/*
  RUN docker-php-ext-configure gd --with-freetype --with-jpeg &amp;&amp; \
    docker-php-ext-install -j &quot;$(nproc)&quot; gd pdo_pgsql
   
  RUN docker-php-ext-configure intl
  RUN docker-php-ext-install pdo pdo_mysql intl zip opcache
   
  RUN pecl install redis &amp;&amp; echo &quot;extension=redis.so&quot; &gt; /usr/local/etc/php/conf.d/docker-php-ext-redis.ini
   
  RUN a2enmod rewrite
   
  RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
  </code></pre>
  <p>Thanks for the help !</p>