Dockerfile.production
FROM ruby:2.5.7
ENV APP_PATH=/greens-app
RUN apt-get update -q && apt-get install -y \
build-essential \
nodejs
RUN mkdir /greens-app
WORKDIR /greens-app
ADD Gemfile /greens-app/Gemfile
ADD Gemfile.lock /greens-app/Gemfile.lock
COPY ./entrypoint-production.sh /usr/local/bin/entrypoint-production.sh
RUN chmod +x /usr/local/bin/entrypoint-production.sh
RUN gem install bundler && bundle install
ADD . /greens-app/
RUN RAILS_ENV=production SECRET_KEY_BASE=no DATABASE_URL='nulldb://fake' bundle exec rake assets:precompile
ENV RAILS_ENV=production \
RAILS_SERVE_STATIC_FILES=true \
RAILS_CACHE_STORE_URL=memcache \
RAILS_LOG_TO_STDOUT=true
EXPOSE 3000
HEALTHCHECK CMD curl --fail http://localhost:3000/ || exit 1
CMD ["entrypoint-production.sh"]