title: How to install packages from Docker compose?
body: <p>Hi there I am new to Docker. I have an <strong>docker-compose.yml</strong> which looks like this:</p>
  
  <pre><code>version: "3"
  
  services:
    lmm-website:
      image: lmm/lamp:php${PHP_VERSION:-71}
      container_name: ${CONTAINER_NAME:-lmm-website}
      environment:
        HOME: /home/user
      command: supervisord -n
      volumes:
        - ..:/builds/lmm/website
        - db_website:/var/lib/mysql
      ports:
        - 8765:80
        - 12121:443
        - 3309:3306
      networks:
        - ntw
  
  volumes:
    db_website:
  
  networks:
    ntw:
  </code></pre>
  
  <p>I want to install the Yarn package manager from within the docker-compose file:</p>
  
  <pre><code>sudo apt-get update &amp;&amp; sudo apt-get install yarn
  </code></pre>
  
  <p>I could not figure out how to declare this, I have tried </p>
  
  <pre><code>command: supervisord -n &amp;&amp; sudo apt-get update &amp;&amp; sudo apt-get install yarn
  </code></pre>
  
  <p>which fails silently. How do I declare this correctly? Or is docker-compose.yml the wrong place for this?</p>