FROM ruby:2.5.1

RUN apt-get -qq update \
  && apt-get -qq install -y \
    build-essential \
    sqlite3 \
    nodejs \
  && apt-get -qq clean \
  && rm -rf \
    /var/lib/apt/lists/* \
    /tmp/* \
    /var/tmp/*

# Set timezone inside the container
RUN echo "America/New_York" > /etc/timezone \
 && rm /etc/localtime \
 && ln -s /usr/share/zoneinfo/America/New_York /etc/localtime

RUN gem install --no-rdoc --no-ri bundler
ADD Gemfile* /tmp/
WORKDIR /tmp
RUN bundle install --without production

RUN mkdir /rails
WORKDIR /rails

ADD . /rails

VOLUME ["/rails"]

EXPOSE 3000

CMD /bin/bash
