title: How to exit leaving docker container running (in jenkins)
body: <p>I am using a docker-compose file for two services. One for React App and another for Nginx server. I am using Jenkins to build periodically (15 minutes period). In jenkins's build section I execute the command <code>docker-compose up --build</code>. But the problem is whenever jenkins start to build it takes unlimited time to finish although both of the containers are already started after a few minutes of starting to build. Due to not finished the first build another build comes into the queue as pending.</p>
  
  <p><strong>Now my question is how to finish the build process when the containers are started.</strong></p>
  
  <p><strong>docker-compose</strong></p>
  
  <pre><code>version: "3"
  services:
    react-app:
      container_name: frontend_app
      build:
        context: .
        dockerfile: ./Dockerfile
      image: frontend_app:dev 
      tty: true
      volumes:
        - my_host_vol:/app/build/      
      networks:
        - frontend_network
  
    nginx-server:    
      image: nginx_for_frontend:dev
      container_name: nginx_for_frontend
      tty: true
      build:
        context: ./nginx
        dockerfile: Dockerfile
      # restart: on-failure
  
      volumes:
        - .:/my_frontend_server
        - my_host_vol:/var/www/html/      
  
      ports:
        - 80:80
      depends_on:
        - react-app
      networks:
        - server_network
  
  networks:
    frontend_network:
      driver: bridge
    server_network:
      driver: bridge
  
  
  volumes:
    my_host_vol:
  </code></pre>
  
  <p><strong>Dockerfile For React app</strong></p>
  
  <pre><code>FROM node:10.16.3
  
  RUN mkdir /app
  
  WORKDIR /app
  
  COPY . /app
  
  ENV PATH /app/node_modules/.bin:$PATH
  
  RUN npm install --silent
  RUN npm install react-scripts@3.0.1 -g --silent
  RUN npm run-script build
  
  </code></pre>
  
  <p><strong>Dockerfile for nginx</strong></p>
  
  <pre><code>FROM nginx:1.16.1-alpine
  
  RUN rm /etc/nginx/conf.d/default.conf
  COPY /prod.conf /etc/nginx/conf.d
  </code></pre>
  
  <p><strong>Screenshot of Jenkins console of build process</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Z7YYC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z7YYC.png" alt="enter image description here"></a></p>