Skip to content
Snippets Groups Projects
Dockerfile-testing 581 B
Newer Older
  • Learn to ignore specific revisions
  • FROM docker.io/node:8-stretch as builder
    
    FORESTIER Fabien's avatar
    FORESTIER Fabien committed
    # Chromium is an headless browser that will let us run or front tests
    
    RUN apt-get update \
        && apt-get install -y chromium
    
    FORESTIER Fabien's avatar
    FORESTIER Fabien committed
    # Copy package.json first allow to cache the modules
    
    COPY ./package.json /app/package.json
    RUN cd /app; npm install
    COPY . /app
    
    FORESTIER Fabien's avatar
    FORESTIER Fabien committed
    # run the test command defined in the package.json
    
    RUN npm run test:ci
    
    COPY --from=builder /app/coverage /usr/share/nginx/html/coverage
    COPY --from=builder /app/tests /usr/share/nginx/html/tests