]> 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 0e47d4e76fa1cbfc167d0c5f5fbf8a9768be76d9..ea05d3052c81a156d150919781459e02ba69442c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,87 +2,20 @@
 
 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.
 
-See the list of [Docker Hub tags](https://hub.docker.com/r/buildkite/puppeteer/tags/) for Puppeteer versions available.
-
-## Usage example
-
-Dockerfile.integration-tests:
-
-```Dockerfile
-FROM buildkite/puppeteer:version
-RUN  npm i mocha
-ENV  PATH="${PATH}:/node_modules/.bin"
-```
-
-docker-compose.integration-tests.yml:
-
-```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"
-```
+## Versions
 
-integration-tests/index.test.js:
-
-```js
-const assert = require('assert')
-const puppeteer = require('puppeteer')
-
-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}`)
-})
+See the list of [Docker Hub tags](https://hub.docker.com/r/buildkite/puppeteer/tags/) for Puppeteer versions available.
 
-beforeEach(async() => {
-  page = await browser.newPage()
-})
+## Example
 
-afterEach(async() => {
-  await page.close()
-})
+See the [example directory](example) for a complete Docker Compose example, showing how to run Puppeteer against a linked Docker Compose web service.
 
-after(async() => {
-  await browser.close()
-})
+## Dependent Services
 
-describe('App', () => {
-  it('renders', async() => {
-    const response = await page.goto('http://app/')
-    assert(response.ok())
-    await page.screenshot({ path: `/screenshots/app.png` })
-  })
-})
-```
+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.
 
-Running:
+## Releasing
 
-```
-docker-compose -f integration-tests run tests
-```
+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.