Skip to content

Instantly share code, notes, and snippets.

@Xotabu4
Created February 28, 2017 12:16
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Xotabu4/a243d9ff25cfe276bcaa0175fb6a4b00 to your computer and use it in GitHub Desktop.
Save Xotabu4/a243d9ff25cfe276bcaa0175fb6a4b00 to your computer and use it in GitHub Desktop.
Simplest way to start protractor in container (as far as i know). Comments are welcome!
version: '2'
services:
selenium-chrome-standalone:
ports:
- "44444:4444"
image: "selenium/standalone-chrome"
e2e-tests:
build: .
links:
- selenium-chrome-standalone
depends_on:
- selenium-chrome-standalone
FROM node:7
COPY . /e2e
WORKDIR /e2e
RUN npm install
CMD npm test
import {Config} from 'protractor';
export let config: Config = {
seleniumAddress: 'http://selenium-chrome-standalone:4444/wd/hub',
// Other settings here...
};
@Xotabu4
Copy link
Author

Xotabu4 commented Feb 28, 2017

To start -
docker-compose build && docker-compose up

@Xotabu4
Copy link
Author

Xotabu4 commented Nov 21, 2017

Another option - is to use

entrypoint.sh
!#/bin/bash
exec npm $@
Dockerfile
...
...
COPY entrypoint.sh .
RUN chmod +x entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
docker-compose.yml
services:
    e2e:
        command:
          - test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment