rails-pitchfork.dockerfile 756 B

123456789101112131415161718192021222324252627282930
  1. FROM ruby:3.5-rc
  2. RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends redis-server
  3. EXPOSE 8080
  4. WORKDIR /rails
  5. # ENV RUBY_YJIT_ENABLE=1 YJIT is enabled in config/initializers/enable_yjit.rb
  6. # Use Jemalloc
  7. RUN apt-get update && \
  8. apt-get install -y --no-install-recommends libjemalloc2
  9. ENV LD_PRELOAD=libjemalloc.so.2
  10. RUN apt-get install -yqq nginx
  11. COPY ./Gemfile* /rails/
  12. ENV BUNDLE_FORCE_RUBY_PLATFORM=true
  13. ENV BUNDLE_WITH=postgresql:pitchfork
  14. RUN bundle install --jobs=8
  15. COPY . /rails/
  16. ENV RAILS_ENV=production_postgresql
  17. ENV PORT=8080
  18. ENV REDIS_URL=redis://localhost:6379/0
  19. CMD service redis-server start && \
  20. nginx -c /rails/config/nginx.conf && \
  21. RACK_ENV=production bundle exec pitchfork -c config/pitchfork.rb