FROM phusion/passenger-ruby22

ENV RAILS_ENV development
ENV BUNDLE_PATH /bundle
# set the app directory var
ENV APP_HOME /home/app
WORKDIR $APP_HOME
RUN apt-get update -qq
# Install apt dependencies
RUN apt-get install -y --no-install-recommends \
  build-essential \
  curl libssl-dev \
  git \
  unzip \
  zlib1g-dev \
  libxslt-dev \
  mysql-client \
  sqlite3
# install bundler
RUN gem install bundler -v 1.6.2
# Separate task from `add . .` as it will be
# Skipped if gemfile.lock hasn't changed *
COPY Gemfile* ./
COPY .env ./.env
# Install gems to /bundle
RUN bundle install
ADD . .
# compile assets!
#RUN bundle exec rake assets:precompile
EXPOSE 3000
CMD ["/sbin/my_init"]