FROM ruby:<%= ruby_version %> <% if ruby_version.include? 'alpine' %> RUN apk add --update mysql-client mysql-dev postgresql-client g++ ruby-dev make <% else %> RUN apt-get update &&\ apt-get -y install mysql-client postgresql-client sqlite3 nodejs --no-install-recommends &&\ rm -rf /var/lib/apt/lists/* <% end %> RUN gem install bundler RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY ./Gemfile /usr/src/app/ COPY ./Gemfile.lock /usr/src/app/ RUN bundle install COPY . /usr/src/app COPY ./<%= PATHS.relative_from_current(PATHS.rails_directory) %>/entry-point.sh /usr/src/app/entry-point.sh COPY ./<%= PATHS.relative_from_current(PATHS.rails_directory) %>/database.yml /usr/src/app/config/database.yml COPY ./<%= PATHS.relative_from_current(PATHS.rails_directory) %>/secrets.yml /usr/src/app/config/secrets.yml EXPOSE <%= application_port %> CMD ["bash", "/usr/src/app/entry-point.sh"]