title: Dockerise Angular 11 - i18n SSR (cannot find module express)
body: <p>I have followed <a href="https://medium.com/javascript-in-plain-english/angular-universal-and-i18n-working-together-8828423e8a68" rel="nofollow noreferrer">this tutorial</a> and it works well but when I try to dockerize, the build is ok but when I run the image an error appears : Error: Cannot find module 'express'</p>
  <p><strong>DockerFile</strong></p>
  <pre><code>    FROM node:12 as buildContainer
      WORKDIR /app
      COPY ./package.json ./package-lock.json /app/
      RUN npm install
      COPY . /app
      # max-old-space is needed to avoid any compilation issues because of missing memory
      ENV NODE_OPTIONS --max-old-space-size=2048
      RUN npm run build:ssr
  
      FROM node:12-alpine
  
      WORKDIR /app
      COPY --from=buildContainer /app/package.json /app
  
      # Get all the code needed to run the app
      COPY --from=buildContainer /app/dist /app/dist
  
      EXPOSE 4000
  
      ENV NODE_ENV production
      CMD [&quot;npm&quot;, &quot;run&quot;, &quot;serve:ssr&quot;]
  </code></pre>
  <p>My dist structure is :</p>
  <p>dist\app</p>
  <ul>
  <li>browser
  -- en
  -- fr</li>
  <li>server
  -- en
  -- fr
  proxy-server.js</li>
  </ul>
  <p><strong>proxy-server.js</strong></p>
  <pre><code>    const express = require(&quot;express&quot;);
      const path = require(&quot;path&quot;);
  
      const getTranslatedServer = (lang) =&gt; {
        const distFolder = path.join(
          process.cwd(),
          `dist/morefont-v4/server/${lang}`
        );
        const server = require(`${distFolder}/main.js`);
        return server.app(lang);
      };
  
      function run() {
        const port = 4000;
  
        // Start up the Node server
        const appFr = getTranslatedServer(&quot;fr&quot;);
        const appEn = getTranslatedServer(&quot;en&quot;);
  
        const server = express();
        server.use(&quot;/fr&quot;, appFr);
        server.use(&quot;/en&quot;, appEn);
        server.use(&quot;&quot;, appEn);
  
        server.listen(port, () =&gt; {
          console.log(`Node Express server listening on http://localhost:${port}`);
        });
      }
  
      run();
  </code></pre>
  <p>Optional question : Do you have a proper way to use I18n with Angular SSR ?</p>
  <p>Question : How can I fix my Docker image in order to importe node_modules ?</p>
  <p>Thank you</p>