Skip to content

Instantly share code, notes, and snippets.

@theoretick
Created November 12, 2017 01:42
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 theoretick/fbf26c739780d90e03d1b338426fa88c to your computer and use it in GitHub Desktop.
Save theoretick/fbf26c739780d90e03d1b338426fa88c to your computer and use it in GitHub Desktop.
ruby2.3.2, chrome headless, alpine Dockerfile
FROM ruby:2.4.2-alpine3.4
MAINTAINER Lucas Charles (theoretick) <me@lucascharles.me>
EXPOSE 8080
ENV APP_PATH /srv/app
RUN echo "http://dl-4.alpinelinux.org/alpine/v3.4/main" >> /etc/apk/repositories && \
echo "http://dl-4.alpinelinux.org/alpine/v3.4/community" >> /etc/apk/repositories
# RUN apk update && \
# apk add curl unzip libexif udev chromium chromium-chromedriver xvfb
RUN apk add --update \
build-base \
libxml2-dev \
libxslt-dev \
postgresql-dev \
curl unzip libexif udev chromium chromium-chromedriver xvfb xorg-server dbus ttf-freefont mesa-dri-swrast \
&& rm -rf /var/cache/apk/*
WORKDIR $APP_PATH
# Do not generate documentation when installing gems and fix shebang
# lines
RUN echo "gem: --no-rdoc --no-ri --env-shebang" >> "$HOME/.gemrc"
ADD [".gems", "/srv/app/.gems"]
RUN gem install dep shotgun rake pry
RUN dep -f /srv/app/.gems install
# Tell pry to use `more` as the pager because the installed
# version of `less` does not support passing the `-R` which
# is used by pry.
ENV PAGER="more"
ENV CHROME_BIN=/usr/bin/chromium-browser
ENV CHROME_PATH=/usr/lib/chromium/
CMD ["puma", "--bind", "tcp://0.0.0.0", "--port", "8080"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment