title: How to containerize a Angular service in a full-stack app?
body: <p>I'm new to Docker and containerization. I have a spring boot app for backend service and front-end uses AngularCLI/Angular4. I tried below code to containerize angular service and running docker-compose up command is giving the following error: </p>
  
  <blockquote>
    <p>Local workspace file ('angular.json') could not be found. Error: Local
    workspace file ('angular.json') could not be found.
    at WorkspaceLoader._getProjectWorkspaceFilePath (/usr/local/lib/node_modules/@angular/cli/models/workspace-loader.js:44:19)</p>
  </blockquote>
  
  <p>Here is my
  Dockerfile:</p>
  
  <pre><code>FROM node:8.11-alpine as node-angular-cli
  
  WORKDIR src/main/java/frontend
  
  RUN npm install -g @angular/cli
  
  EXPOSE 4200
  
  CMD ["ng", "serve", "--proxy", "-", "config", "proxy.conf.json"]
  </code></pre>
  
  <p>docker-compose.yaml</p>
  
  <pre><code>version: '3'
  
  services:
  
    db:
        image: mysql:latest
        restart: always
        environment:
          MYSQL_DATABASE: root
          MYSQL_ROOT_PASSWORD: root
          MYSQL_USER: root
          MYSQL_PASSWORD: root
        ports:
          - "3306:3306"
    angular:
        build:
          context: .
          dockerfile: Dockerfile
        ports:
          - "4200:4200"
  </code></pre>
  
  <p>Is there a better way to containerize this application? I was successful in containerizing the whole application but it seems the front-end part doesn't work as surely I didn't include the configuration required for angular service to be up and running( ng serve cmd and its related install details) when containerizing and thus, creating a new DockerFile (shown above)? Can I just have 1 Dockerfile serving the purpose for running both these services?</p>