]> git.immae.eu Git - github/fretlink/docker-puppeteer.git/blobdiff - README.md
Merge pull request #3 from paulrbr-fl/add-git-bin
[github/fretlink/docker-puppeteer.git] / README.md
index 3d200de9a0e4c2b46960f83f90524af24fa051c3..ea05d3052c81a156d150919781459e02ba69442c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,86 +1,21 @@
 # Docker Puppeteer
 
-A base image for running Puppeteer scripts. Add your own tools (such as Jest, Mocha, etc), link services you want to test via Docker Compose, and run your Puppeteer scripts with a headless Chromium.
+A Node + Puppeteer base image for running Puppeteer scripts. Add your own tools (such as Jest, Mocha, etc), link services you want to test via Docker Compose, and run your Puppeteer scripts with a headless Chromium.
 
-## Usage example
+## Versions
 
-Dockerfile.integration-tests:
+See the list of [Docker Hub tags](https://hub.docker.com/r/buildkite/puppeteer/tags/) for Puppeteer versions available.
 
-```Dockerfile
-FROM buildkite/puppeteer:1.3.0
-RUN  npm i mocha@5
-ENV  PATH="${PATH}:/node_modules/.bin"
-```
+## Example
 
-docker-compose.integration-tests.yml:
+See the [example directory](example) for a complete Docker Compose example, showing how to run Puppeteer against a linked Docker Compose web service.
 
-```yml
-version: '3'
-services:
-  tests:
-    build:
-      context: .
-      dockerfile: Dockerfile.integration-tests
-    volumes:
-      - "./integration-tests:/integration-tests"
-      - "/screenshots"
-    command: mocha --recursive /integration-tests
-    links:
-      - app
-  app:
-    image: tutum/hello-world
-    expose:
-      - "80"
-```
+## Dependent Services
 
-integration-tests/index.test.js:
+This image includes [wait-for-it.sh](https://github.com/vishnubob/wait-for-it) which can be useful if you need to wait for a dependent web service to start accepting requests before your Puppeteer container attempts connecting to it. See [the example](example) for usage.
 
-```js
-const assert = require('assert')
-const puppeteer = require('puppeteer')
+## Releasing
 
-let browser
-let page
-
-before(async() => {
-  browser = await puppeteer.launch({
-    args: [
-      // Required for Docker version of Puppeteer
-      '--no-sandbox',
-      '--disable-setuid-sandbox',
-      // This will write shared memory files into /tmp instead of /dev/shm,
-      // because Docker’s default for /dev/shm is 64MB
-      '--disable-dev-shm-usage'
-    ]
-  })
-
-  const browserVersion = await browser.version()
-  console.log(`Started ${browserVersion}`)
-})
-
-beforeEach(async() => {
-  page = await browser.newPage()
-})
-
-afterEach(async() => {
-  await page.close()
-})
-
-after(async() => {
-  await browser.close()
-})
-
-describe('App', () => {
-  it('renders', async() => {
-    const response = await page.goto('http://app/')
-    assert(response.ok())
-    await page.screenshot({ path: `/screenshots/app.png` })
-  })
-})
-```
-
-Running:
-
-```
-docker-compose -f integration-tests run tests
-```
\ No newline at end of file
+1. Create a new release on GitHub. The image is tagged with the same version as Puppeteer.
+2. Docker Hub automatically builds images for the tag.
+3. There is no step 3.