Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

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
You can’t perform that action at this time.