Skip to content

Instantly share code, notes, and snippets.

@miked0004
Last active November 14, 2016 12:55
Show Gist options
  • Save miked0004/b4aa62b62afbb16c67528f7b5f520041 to your computer and use it in GitHub Desktop.
Save miked0004/b4aa62b62afbb16c67528f7b5f520041 to your computer and use it in GitHub Desktop.
Docker phantomjs ruby test box
From ruby:2.3.1
RUN apt-get update
RUN apt-get install build-essential chrpath libssl-dev libxft-dev -y \
&& apt-get install libfreetype6 libfreetype6-dev -y \
&& apt-get install libfontconfig1 libfontconfig1-dev -y
RUN set -xeu \
\
&& PHANTOM_VERSION="phantomjs-2.1.1" \
&& ARCH=$(uname -m) \
&& PHANTOM_JS="$PHANTOM_VERSION-linux-$ARCH" \
&& wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2 \
&& tar xvjf $PHANTOM_JS.tar.bz2 \
&& mv $PHANTOM_JS /usr/local/share \
&& ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin \
&& rm -f $PHANTOM_JS.tar.bz2
@miked0004
Copy link
Author

miked0004 commented Oct 7, 2016

docker-compose.yml

#
# to run this:
# docker-compose up
#  or
# docker-compose run testbox
#
# stop it:
# docker-compose down
#
# rebuild image (when dockerfile changes)
# docker-compose build
#
# this will use bundler to install from your Gemfile[.lock] and run your tests with Guard
#
version: '2'
services:
  testbox:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
    - $PWD/:/host
    - $PWD/dockerbox/gem_home:/usr/local/bundle
    command: 'bash -c "cd /host && bundle install && rake"'

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