title: Docker container: exit code 1 but no error message
body: <p>I have a simple Angular project (currently just the result of <code>ng new ...</code>) inside a docker container. The container is running the command <code>ng build --watch</code> to rebuild on source code changes. A separate docker container runs Nginx to allow me to view the result. The basic mechanics of all this appear to be working fine: I can edit source code, hit refresh in the browser and see the changes.</p>
  <p>When I stop the containers, the nginx container exits cleanly, but the angular contain exits with status 1. There is no error message to help me figure out what the error is.</p>
  <p><strong>Dockerfile</strong></p>
  <pre><code>FROM node:lts-alpine
  RUN apk --no-cache add less bash jq curl wget zip git openssh
  WORKDIR /app
  </code></pre>
  <p><strong>docker-compose.yml</strong></p>
  <pre><code>version: &quot;3.7&quot;
  
  services:
  
    nginx:
      image: nginx:stable-alpine
      restart: always
      ports:
        - 8080:80
      volumes:
        - ./src/admin/build:/var/www
        - ./nginx.conf:/etc/nginx/conf.d/default.conf
  
    admin:
      image: angular # Custom image
      build: .
      working_dir: /app
      command: sh -c &quot;yarn &amp;&amp; yarn run watch&quot; # &quot;watch&quot; = &quot;ng build --watch&quot;
      volumes:
        - ./src/admin:/app
  </code></pre>
  <pre><code>$ docker-compose up -d
  $ docker-compose stop
  $ docker inspect admin_1 | jq '.[0].State'
  {
    &quot;Status&quot;: &quot;exited&quot;,
    &quot;Running&quot;: false,
    &quot;Paused&quot;: false,
    &quot;Restarting&quot;: false,
    &quot;OOMKilled&quot;: false,
    &quot;Dead&quot;: false,
    &quot;Pid&quot;: 0,
    &quot;ExitCode&quot;: 1,
    &quot;Error&quot;: &quot;&quot;,
    &quot;StartedAt&quot;: &quot;2020-09-30T01:10:29.063483594Z&quot;,
    &quot;FinishedAt&quot;: &quot;2020-09-30T01:10:49.396912972Z&quot;
  }
  </code></pre>
  <p>The docker logs show nothing unexpected, other than:</p>
  <pre><code>nginx_1 exited with code 0
  admin_1 exited with code 1
  </code></pre>
  <p>Why isn't the angular container exiting cleanly with exit code 0?</p>