title: Trying to run npm start command in the docker file in the background
body: <p>I am new to docker.</p>
  <p>I am trying to have a docker file built on ubuntu with apache2, .net core, node js.
  I am trying to run the sample nodejs app in the file.
  But every time the &quot;npm run&quot; command comes while building, it goes to creating the development server and doesn't go to the next step.</p>
  <p>Is there a way I can run that in the background or come out of it like (ctl+c) we do on the terminal?</p>
  <p>Here is the docker file:</p>
  <pre><code>    FROM ubuntu:18.04
  
  RUN echo &quot;welcome to yellow pages&quot;
  RUN apt-get update
  RUN apt-get install -y tzdata
  RUN apt-get install -y apache2
  
  ENV APACHE_RUN_USER www-data
  ENV APACHE_RUN_GROUP www-data
  ENV APACHE_LOG_DIR /var/log/apache2
  ENV APACHE_RUN_DIR /var/run/apache2
  RUN mkdir -p ${APACHE_RUN_DIR}
  ENV APACHE_PID_FILE /var/run/apache2/apache2.pid
  RUN touch /etc/apache2/sites-available/yellowpages.conf
  RUN echo '&lt;VirtualHost *:80&gt; \n\
      ServerName myserver.mydomain.com \n\
      ServerAdmin webmaster@localhost \n\
      DocumentRoot /var/www/html \n\
      ErrorLog ${APACHE_LOG_DIR}/error.log \n\
      CustomLog ${APACHE_LOG_DIR}/access.log combined \n\
      &lt;/VirtualHost&gt; \n'\
  &gt;&gt; /etc/apache2/sites-available/yellowpages.conf
  
  RUN cat /etc/apache2/sites-available/yellowpages.conf
  RUN echo 'ServerName myserver.mydomain.com' &gt;&gt; /etc/apache2/apache2.conf
  RUN a2ensite yellowpages.conf
  RUN a2dissite 000-default.conf
  RUN echo 'Hello, docker' &gt; /var/www/index.html
  
  
  # installing nodejs12 on to the container 
  RUN apt-get install -y curl
  RUN apt-get install -y sudo
  RUN curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
  RUN sudo sudo apt-get install -y nodejs
  
  # installing .net core 3.1 on to the container
  RUN apt-get install -y wget
  RUN wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
  RUN dpkg -i packages-microsoft-prod.deb
  RUN apt-get update
  RUN apt-get install -y dotnet-sdk-3.1
  RUN dotnet --list-sdks
  RUN dotnet --list-runtimes
  
  #Running a demo node app
  
  RUN npx create-react-app my-app
  
  # COPY /my-app/package*.json ./
  # RUN npm start
  
  ENTRYPOINT [&quot;/usr/sbin/apache2&quot;]
  CMD [&quot;-D&quot;, &quot;FOREGROUND&quot;]  
  RUN cd my-app &amp;&amp; nohup npm start
  EXPOSE 80 
  EXPOSE 3000
  </code></pre>
  <p>This is the output I get where I am stuck</p>
  <p><a href="https://i.stack.imgur.com/Hqu3K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hqu3K.png" alt="output" /></a></p>
  <p>Because of this Docker image is not being created as it is stuck in this step.</p>
  <p>Could anyone help me out with this?</p>