Create a gist now

Instantly share code, notes, and snippets.

@a-leung /Dockerfile
Last active Apr 20, 2018

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