title: Docker with Angular 2: cannot get
body: <p>We're trying to set up an Angular 2 application with Docker following this tutorial: <a href="https://scotch.io/tutorials/create-a-mean-app-with-angular-2-and-docker-compose" rel="nofollow noreferrer">https://scotch.io/tutorials/create-a-mean-app-with-angular-2-and-docker-compose</a></p>
  
  <p>The application deploys but we get 'Cannot GET /'</p>
  
  <p>This is how we build our app:</p>
  
  <pre><code>sudo docker build -t frontend:dev .
  </code></pre>
  
  <p>and this is how we run our app</p>
  
  <pre><code>sudo docker run -d --name frontend -p 1014:4200 frontend:dev
  </code></pre>
  
  <p>Our dockerfile is exactly the same as the tutorial:</p>
  
  <pre><code># Create image based on the official Node 6 image from dockerhub
  FROM node:6
  
  # Create a directory where our app will be placed
  RUN mkdir -p /usr/src/app
  
  # Change directory so that our commands run inside this new directory
  WORKDIR /usr/src/app
  
  # Copy dependency definitions
  COPY package.json /usr/src/app
  
  # Install dependecies
  RUN npm install
  
  # Get all the code needed to run the app
  COPY . /usr/src/app
  
  # Expose the port the app runs in
  EXPOSE 4200
  
  # Serve the app
  CMD ["npm", "start"]
  </code></pre>
  
  <p>And this is an excerpt from package.json</p>
  
  <pre><code>{
    "name": "courseka",
    "version": "0.0.0",
    "scripts": {
      "start": "ng serve -H 0.0.0.0"
      "build": "ng build"
    }
  }
  </code></pre>
  
  <p>And as last, something from our index.html file</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;base href="/"&gt;
    &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>