Skip to content

Instantly share code, notes, and snippets.

@BretFisher
Created November 17, 2016 20:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save BretFisher/90bf1b78cf51c29bf428ca361bdb1437 to your computer and use it in GitHub Desktop.
Save BretFisher/90bf1b78cf51c29bf428ca361bdb1437 to your computer and use it in GitHub Desktop.
Dockerfile selenium with nodejs
FROM selenium/standalone-chrome
# lets install node 6.x then cleanup
# install build-essential and leave in case npm needs it
# we have to sudo because selenium defaults to seluser
WORKDIR /tmp
ADD https://deb.nodesource.com/setup_6.x nodesource_setup.sh
RUN sudo bash nodesource_setup.sh \
&& sudo apt-get install -y nodejs build-essential \
&& sudo rm -rf /var/lib/apt/lists/*
# prep for our nodejs app
RUN sudo mkdir -p /usr/src/app
WORKDIR /usr/src/app
# cache package.json and node_modules to speed up builds
COPY package.json package.json
RUN sudo npm install
# Add your source files
COPY . .
CMD ["npm","start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment