Update Dockerfile to install Headless Chrome

This commit is contained in:
Angel Perez
2018-03-28 10:14:57 -04:00
parent f9940980b0
commit ff1fced609
2 changed files with 13 additions and 3 deletions

View File

@@ -1,7 +1,8 @@
# Use Ruby 2.3.6 as base image
FROM ruby:2.3.6
# Install essential Linux packages
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client nodejs imagemagick sudo
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client nodejs imagemagick sudo libxss1 libappindicator1 libindicator7 unzip
# Files created inside the container repect the ownership
RUN adduser --shell /bin/bash --disabled-password --gecos "" consul \
@@ -34,9 +35,18 @@ COPY Gemfile_custom Gemfile_custom
# Prevent bundler warnings; ensure that the bundler version executed is >= that which created Gemfile.lock
RUN gem install bundler
# Finish establishing our Ruby enviornment
# Finish establishing our Ruby environment
RUN bundle install --full-index
# Install Chromium and ChromeDriver for E2E integration tests
RUN apt-get update -qq && apt-get install -y chromium-browser
RUN wget -N http://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip
RUN unzip chromedriver_linux64.zip
RUN chmod +x chromedriver
RUN mv -f chromedriver /usr/local/share/chromedriver
RUN ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
RUN ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
# Copy the Rails application into place
COPY . .