Skip to content
Snippets Groups Projects
Dockerfile 549 B
Newer Older
  • Learn to ignore specific revisions
  • # Stage 0, based on Node.js, to build and compile Angular
    FROM node:8.10.0 as builder
    
    # Copy the package.json file first in order to cache the modules
    COPY ./package.json /app/package.json
    WORKDIR /app
    # Install npm dependencies
    RUN npm install
    # Copy the project
    COPY . /app
    
    
    # Building the Angular app /dist 
    
    
    # Stage 1, based on Nginx, to have only the compiled app
    FROM nginx
    
    COPY --from=builder /app/dist /usr/share/nginx/html
    RUN ls -l /usr/share/nginx/html
    EXPOSE 80
    
    CMD ["nginx", "-g", "daemon off;"]