title: Deploy production create-react-app via GitLab Auto DevOps to GKE
body: <p>I've been struggling to figure out why my <code>create-react-app</code> application won't display properly when using GitLab Auto DevOps and deploy to GKE. I'm thinking that it has something to do with how I'm serving the <code>create-react-app</code> and how the ingress-controller works, but I'm not totally sure. </p>
  
  <p>For production, <code>create-react-app</code> suggests using <code>yarn build</code> and then package <a href="https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#deployment" rel="nofollow noreferrer">serve</a> but I don't think that <code>serve</code> and ingress-controller play nice together. For reference here is my Dockerfile:</p>
  
  <p><strong>Dockerfile</strong></p>
  
  <pre><code>FROM node:8.9.3-alpine
  
  ARG NODE_ENV=production
  ENV NODE_ENV=$NODE_ENV
  
  # Set a working directory
  WORKDIR /usr/src/app
  
  COPY package.json yarn.lock ./
  RUN set -ex; \
    if [ "$NODE_ENV" = "production" ]; then \
    yarn install --no-cache --frozen-lockfile --production; \
    npm install -g serve; \
    elif [ "$NODE_ENV" = "test" ]; then \
    touch yarn-error.log; \
    mkdir -m 777 build; \
    yarn install --no-cache --frozen-lockfile; \
    chown -R node:node build node_modules package.json yarn.lock yarn-error.log; \
    else \
    touch yarn-error.log; \
    mkdir -p -m 777 build node_modules /home/node/.cache/yarn; \
    chown -R node:node build node_modules package.json yarn.lock yarn-error.log /home/node/.cache/yarn; \
    fi;
  
  
  COPY .env build* ./build/
  
  USER node
  
  CMD [ "serve", "-s", "build" ]
  </code></pre>
  
  <p>My application is really simple, it's just a single page with a few dummy routes. </p>
  
  <p>When I push to master the whole pipeline succeeds, but the result is sort of a rendered view of my projects file structure. I've looked over the logs and the only thining that seems to be indicating any issue other that the state of the website is the ingress-controller logs which <code>WARN</code> me:</p>
  
  <pre><code>error obtaining PEM from secret app-6174385/production-auto-deploy-tls: error retrieving secret app-6174385/production-auto-deploy-tls: secret app-6174385/production-auto-deploy-tls was not found 
  </code></pre>
  
  <p>Has anyone had success deploying create-react-app to GKE via GitLab's Auto DevOps, if so I could really use some guidance. Also, happy to provide any additional information that would be helpful!</p>