grape-iodine.dockerfile 500 B

123456789101112131415161718192021222324
  1. FROM ruby:4.0-rc
  2. ENV RUBY_YJIT_ENABLE=1
  3. # Use Jemalloc
  4. RUN apt-get update && \
  5. apt-get install -y --no-install-recommends libjemalloc2
  6. ENV LD_PRELOAD=libjemalloc.so.2
  7. RUN apt-get update -yqq && apt-get install -yqq nginx
  8. ADD ./ /grape
  9. WORKDIR /grape
  10. RUN bundle config set with 'iodine'
  11. RUN bundle install --jobs=8 --gemfile=/grape/Gemfile
  12. ENV RACK_ENV=production
  13. ENV MAX_THREADS=1
  14. EXPOSE 8080
  15. CMD bundle exec iodine -p 8080 -w $(ruby config/auto_tune.rb | grep -Eo '[0-9]+' | head -n 1)