Skip to content

Commit

Permalink
docs(README): Update demo app
Browse files Browse the repository at this point in the history
- Demo app updated
- New Demo App section to the README file
  • Loading branch information
andreasonny83 committed Feb 2, 2020
1 parent 2fb4d9d commit 7c572a4
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 2,275 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ $ npm install -g lighthouse-ci
- [Option 2.](#option-2)
- [Option 3.](#option-3)
- [Codechecks](#codechecks)
- [Demo App](#demo-app)
- [How to](#how-to)
- [Test a page that requires authentication](#test-a-page-that-requires-authentication)
- [Wait for post-load JavaScript to execute before ending a trace](#wait-for-post-load-javascript-to-execute-before-ending-a-trace)
Expand Down Expand Up @@ -235,6 +236,17 @@ Read more from the official documentation from [https://github.com/codechecks/li

Read more about Codechecks on the [official project website](https://codechecks.io/)

## Demo App

This project contains a demo folder where a project as been created for demo purposes only.
Once inside the `demo` folder, if you have Docker installed on your machine, you can simply launch the demo app inside a Docker container with `make demo`.

If you just want to run the demo locally, make sure to install the node dependencies first with `npm install`,
then run the demo with:

```
$ npm start
```

## How to

Expand Down
1 change: 1 addition & 0 deletions demo/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
16 changes: 7 additions & 9 deletions demo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
FROM node:carbon
FROM node:10

WORKDIR /demo

ENV CHROME_BIN=/usr/bin/google-chrome-stable
EXPOSE 8080

# Install Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt-get update && apt-get install -y google-chrome-stable

ENV CHROME_BIN=/usr/bin/google-chrome-stable

COPY package*.json /demo/

# RUN npm install
COPY package.json .

# Bundle app source
# COPY . .
RUN npm install

# EXPOSE 8080
COPY . .
5 changes: 1 addition & 4 deletions demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ build:
run:
docker run --rm -it -v ${PWD}:/demo sonny/lighthouse-demo npm start

install:
docker run --rm -it sonny/lighthouse-demo npm install

dev:
docker run -it --rm -v ${PWD}:/demo sonny/lighthouse-demo /bin/bash

demo: build install run
demo: build run
Loading

0 comments on commit 7c572a4

Please sign in to comment.