title: How to write bitbucket pipeline for deploying my angular universal app?
body: <p>I am trying to deploy my angular universal app on server through bitbucket pipeline. I have written scripts in <code>bitbucket-pipelines.yml</code> as follows:</p>
  <pre><code>pipelines:
    default:
      - step:
          name: Build app
          caches:
            - node
          script:
            - npm install
            - npm install -g @angular/cli
            - npm run build:ssr
            - npm run serve:ssr
          artifacts:
            - dist/**
  </code></pre>
  <p>My <code>package.json</code> has following scripts:</p>
  <pre><code>&quot;scripts&quot;: {
          &quot;ng&quot;: &quot;ng&quot;,
          &quot;start&quot;: &quot;ng serve -c=dev -o&quot;,
          &quot;build&quot;: &quot;ng build&quot;,
          &quot;test&quot;: &quot;ng test&quot;,
          &quot;lint&quot;: &quot;ng lint&quot;,
          &quot;e2e&quot;: &quot;ng e2e&quot;,
          &quot;build:ssr&quot;: &quot;npm run build:client-and-server-bundles &amp;&amp; npm run webpack:server&quot;,
          &quot;serve:ssr&quot;: &quot;node dist/server.js&quot;,
          &quot;build:client-and-server-bundles&quot;: &quot;ng build --prod &amp;&amp; ng run my-app:server&quot;,
          &quot;webpack:server&quot;: &quot;webpack --config webpack.server.config.js --progress --colors&quot;
      },
  </code></pre>
  <p>When <code>npm run serve:ssr</code> executes, I see that it gives same output as on localhost i.e. <code>Node server listening on http://localhost:4000</code>. It gets stuck at this point. What am I doing wrong here?</p>