title: run a script after docker-compose run (npm)
body: <p>I am an absolute beginner on this.</p>
  <p>I need to run two containers, with two separate apps.
  One of them should run a script (which runs npm start and not much else), but that might not be possible?</p>
  <p>Dockerfile</p>
  <pre><code>FROM node:14.16.0-buster
  RUN apt-get update &amp;&amp; apt-get install -y libsecret-1-dev groff less bash-completion &amp;&amp; rm -rf /var/lib/apt/lists/*
  ENV npm_config_user root
  COPY startscript.sh /usr/local/bin
  RUN chmod +x /usr/local/bin/startscript.sh
  ENTRYPOINT []
  </code></pre>
  <p>And the docker-compose.yml</p>
  <pre><code>version: '3'
  
  services:
      first-container:
          build:
              context: .
          ports:
              - '8080:8080' # node web interface
          env_file: .env
          command: bash -c &quot;/usr/local/bin/startscript.sh&quot;
  
      second-container:
          build:
              context: .
          ports:
          - '8181:8181' # node main app web interface
  
         # volumes:
  
   volumes:
      node-modules: # persist local node_modules
  </code></pre>
  <p>I can run the containers, but the script doesn't run automatically.
  Suggestions?</p>
  <p>thanks</p>