title: containerized ReactJs application (from nginx image )does not serve all routes
body: <p>I am trying to deploy a ReactJS service on GKE. I used Nginx to build my react images (I used create-react-app, and react router).</p>
  
  <p>This is my dockerfile </p>
  
  <pre><code>FROM node:8.9.3-alpine as build-deps2
  RUN mkdir /irooltest WORKDIR /irooltest COPY . /irooltest
  RUN npm install RUN npm run build
  
  FROM nginx:1.12-alpine 
  COPY --from=build-deps2 /irooltest/build /usr/share/nginx/html
  EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]
  </code></pre>
  
  <p>and this my docker compose file:</p>
  
  <pre><code>services:
    irooltest:
       image: chaimaennar/irooltest
       ports:
        - 8080:80
       networks:
              default:
  
  networks:
     default:
        external:
          name: mynetwork
  </code></pre>
  
  <p>I tried to export my application to ports other than 80, but I was not able to ( I got that this is due to nginx which is my default configured to serve on port 80).</p>
  
  <p>Another issue is when running my application it only shows the root page, any other (route that I defined with react router) shows:</p>
  
  <blockquote>
    <p>404 Not Found nginx/1.12.2</p>
  </blockquote>
  
  <p>When I see the source (in the inspection section in the browser) I see this:</p>
  
  <pre><code>-Top
    -localhost:8080
      -static
      -index.css
    -Webpack://
  </code></pre>
  
  <p>Under the webpack I am able to see all my folders (code).</p>
  
  <p>These are my routes:</p>
  
  <p>
      </p>
  
  <pre><code>  &lt;Route path="/home" render={(props) =&gt; &lt;Layout auth={auth} {...props} /&gt;} /&gt; 
    &lt;Route path="/" render={(props) =&gt; &lt;App auth={auth} {...props} /&gt;} /&gt; 
    &lt;Route path="/logo" render={(props) =&gt; &lt;Logo /&gt;} /&gt; 
  
    &lt;Route path="/callback" render={(props) =&gt; {
      handleAuthentication(props);
      return &lt;Callback {...props} /&gt; }}/&gt;
  
    &lt;Route path="/profile" render={(props) =&gt; (&lt;Profile auth={auth} {...props}/&gt;
      )
  } /&gt; 
  
  &lt;Route path="/user" render={(props) =&gt; &lt;UserForm auth={auth} {...props} /&gt;} /&gt;
  &lt;/div&gt;
  &lt;/Router&gt;
  </code></pre>
  
  <p>My question is: </p>
  
  <p>Is that a normal behavior? </p>
  
  <p>Should it be a special configuration for nginx to serve the routes?</p>