title: How to run `httpd` in Docker in detached mode using CMD in Dockerfile?
body: <p>This is my Dockerfile -
  The image builds successfully but it doesn't run, it stops. I want to access the website being served from the Apache server from Docker container.</p>
  <pre><code># build environment
  FROM node:13.12.0-alpine as build
  WORKDIR /app
  ENV PATH /app/node_modules/.bin:$PATH
  COPY package.json ./
  COPY package-lock.json ./
  RUN npm ci --silent
  RUN npm install react-scripts@3.4.1 -g --silent
  COPY . ./
  RUN npm run build:staging
  
  # production environment
  FROM httpd:latest
  COPY --from=build /app/build /usr/local/apache2/htdocs
  
  EXPOSE 80
  
  CMD [&quot;httpd&quot;]
  </code></pre>