Skip to content

Instantly share code, notes, and snippets.

@a-leung
Last active April 20, 2018 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-leung/320d8a723ebc960ee10227c14759aa27 to your computer and use it in GitHub Desktop.
Save a-leung/320d8a723ebc960ee10227c14759aa27 to your computer and use it in GitHub Desktop.
FROM ruby:2.5.1-slim
RUN apt-get update && apt-get install -qq -y --no-install-recommends \
build-essential \
libsqlite3-dev \
nodejs \
sqlite3 \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /app
WORKDIR /app
COPY Dockerfile Gemfile* .
RUN echo "#!/bin/bash\n" \
"if [ ! -e \"Gemfile\" ]; then\n" \
" echo \"Creating default Gemfile\"\n" \
" echo \"ruby '2.5.1'\n" \
" source 'https://rubygems.org'\n" \
" gem 'rails', '~> 5.1.0'\" > Gemfile\n" \
"fi\n" > script.sh
RUN chmod +x script.sh
RUN ./script.sh
RUN bundle install
RUN rails new temp_app
RUN rm -rf temp_app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment