Skip to content

Instantly share code, notes, and snippets.

@lmmendes
Last active February 13, 2017 23:43
Show Gist options
  • Select an option

  • Save lmmendes/87abbad4506744cfac9db1e8d856948f to your computer and use it in GitHub Desktop.

Select an option

Save lmmendes/87abbad4506744cfac9db1e8d856948f to your computer and use it in GitHub Desktop.
bitbucket pipelines + mysql + rails + cache
FROM ruby:2.4.0
MAINTAINER liquid team <[email protected]>
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -q &&\
apt-get upgrade -y -q &&\
apt-get install -y curl software-properties-common curl &&\
curl -sL https://deb.nodesource.com/setup_7.x | bash &&\
apt-get -y install nodejs mysql-server mysql-client libmysqlclient-dev --no-install-recommends
# skip installing gem documentation
RUN mkdir -p /usr/local/etc \
&& { \
echo 'install: --no-document'; \
echo 'update: --no-document'; \
} >> /usr/local/etc/gemrc
ENV GEM_HOME /usr/local/bundle
ENV BUNDLE_PATH="$GEM_HOME" \
BUNDLE_BIN="$GEM_HOME/bin" \
BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_APP_CONFIG="$GEM_HOME"
ENV PATH $BUNDLE_BIN:$PATH
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
COPY Gemfile Gemfile.lock ./tmp/
RUN cd /tmp && bundle install
# Don't forget to cleanup after our ourselves
RUN apt-get clean &&\
apt-get -y -q autoclean &&\
apt-get -y -q autoremove &&\
rm -rf /tmp/* &&\
rm -rf /var/lib/apt/lists/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment