title: GraphQL ERESOLVE unable to resolve dependency tree when building my docker container
body: <p>Here are my files.</p>
  <p>Here is I think the core of the problem.</p>
  <pre><code>Could not resolve dependency:
  npm ERR! peer graphql@&quot;^0.12.0 || ^0.13.0 || ^14.0.0&quot; from graphql-middleware@4.0.2
  </code></pre>
  <h1>docker-compose.yml</h1>
  <pre><code>version: '3.7'
  
  services:
    apollo:
      container_name: apollo
      build:
        context: .
        dockerfile: Dockerfile
      environment:
          -  NODE_ENV=development
      volumes:
        - '.:/app'
        - '/app/node_modules'
  
      ports:
        - 4000:4000
  
      restart: always
  </code></pre>
  <h1>Dockerfile</h1>
  <pre><code># Use the official image as a parent image.
  FROM node:current-slim
  
  # Set the working directory.
  WORKDIR /app
  
  # Setting environment path.
  ENV PATH=/app/node_modules/.bin:$PATH
  
  # Copy the file from your host to your current location.
  COPY package.json .
  
  # Run the command inside your image filesystem.
  RUN npm init --yes
  RUN npm install --save cors apollo-server-express express graphql reflect-metadata type-graphql apollo-datasource-rest soap jsonwebtoken --yes
  RUN npm install nodemon -g --yes
  
  # Add metadata to the image to describe which port the container is listening on at runtime.
  EXPOSE 4000
  
  # Copy the rest of your app's source code from your host to your image filesystem.
  COPY . .
  CMD [ &quot;nodemon&quot;, &quot;index.js&quot; ]
  </code></pre>
  <h1>Dependency Error</h1>
  <pre><code>$ docker-compose up --build
  Building apollo
  Step 1/10 : FROM node:current-slim
   ---&gt; f3f62dfcc735
  Step 2/10 : WORKDIR /app
   ---&gt; Using cache
   ---&gt; 33088e65c748
  Step 3/10 : ENV PATH=/app/node_modules/.bin:$PATH
   ---&gt; Using cache
   ---&gt; c7f742267b26
  Step 4/10 : COPY package.json .
   ---&gt; Using cache
   ---&gt; 76285ea4a8ca
  Step 5/10 : RUN npm init --yes
   ---&gt; Using cache
   ---&gt; 29a3d715136b
  Step 6/10 : RUN npm install --save cors apollo-server-express express graphql reflect-metadata type-graphql apollo-datasource-rest soap jsonwebtoken --yes
   ---&gt; Running in 1e4472bcd901
  npm ERR! code ERESOLVE
  npm ERR! ERESOLVE unable to resolve dependency tree
  npm ERR! 
  npm ERR! While resolving: apollo-express-server@1.0.0
  npm ERR! Found: graphql@15.4.0
  npm ERR! node_modules/graphql
  npm ERR!   graphql@&quot;^15.3.0&quot; from the root project
  npm ERR! 
  npm ERR! Could not resolve dependency:
  npm ERR! peer graphql@&quot;^0.12.0 || ^0.13.0 || ^14.0.0&quot; from graphql-middleware@4.0.2
  npm ERR! node_modules/graphql-middleware
  npm ERR!   graphql-middleware@&quot;^4.0.2&quot; from the root project
  npm ERR! 
  npm ERR! Fix the upstream dependency conflict, or retry
  npm ERR! this command with --force, or --legacy-peer-deps
  npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
  npm ERR! 
  npm ERR! See /root/.npm/eresolve-report.txt for a full report.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /root/.npm/_logs/2020-11-05T16_19_42_605Z-debug.log
  ERROR: Service 'apollo' failed to build : The command '/bin/sh -c npm install --save cors apollo-server-express express graphql reflect-metadata type-graphql apollo-datasource-rest soap jsonwebtoken --yes' returned a non-zero code: 1
  </code></pre>