title: Exit code 1 in AWS ECS?
body: <p>I am trying to publish an application to AWS Elastic Container Service(ECS). I am using the ECS CLI to compose my docker-compose file. There are 2 Docker components. A web container(Flask application) and a server container(NGINX). When just the web container runs all is ok but when I run the server I always get Exit code 1.</p>
  <p><em>docker-compose.yaml</em></p>
  <pre><code>version: &quot;3&quot;
  
  services:
      web:
          image: 131099/generateme
          expose:
              - 5000
          logging:
              driver: awslogs
              options: 
                  awslogs-group: generateme
                  awslogs-region: eu-west-2
                  awslogs-stream-prefix: web
      server:
          image: 131099/generateme-server
          ports:
              - 80:80
          environment:
              - DOCKER_PROVIDER = ecs
              - DEBUG = true
          depends_on:
              - web
          logging:
              driver: awslogs
              options: 
                  awslogs-group: generateme
                  awslogs-region: eu-west-2
                  awslogs-stream-prefix: server
  </code></pre>
  <p><em>Dockerfile 131099/generateme-server</em></p>
  <pre><code>FROM nginx
  
  RUN rm /etc/nginx/conf.d/default.conf
  COPY nginx.conf /etc/nginx/conf.d
  </code></pre>
  <p><em>nginx.conf</em></p>
  <pre><code>upstream generateme {
      server web:5000;
  }
  
  server {
  
      listen 80;
  
      location / {
          proxy_pass http://generateme;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $host;
          proxy_redirect off;
      }
  
  }
  </code></pre>
  <p>Any ideas why the exit code is 1? I have checked the logs and it says:</p>
  <pre><code>nginx: [emerg] host not found in upstream &quot;web:5000&quot; in /etc/nginx/conf.d/nginx.conf:2
  </code></pre>
  <p>Shouldn't the web container be up first before the server because of the <code>depends_on</code> property?</p>