Performance: Docker deployment
MEDIUM IMPACT
Docker deployment affects the initial page load speed and server response time by controlling how the Rails app and its dependencies are packaged and started.
FROM ruby:3.1-slim RUN apt-get update && apt-get install -y --no-install-recommends nodejs yarn WORKDIR /app COPY Gemfile Gemfile.lock ./ RUN bundle install --without development test COPY . . CMD ["rails", "server", "-b", "0.0.0.0"]
FROM ruby:3.1 RUN apt-get update && apt-get install -y nodejs COPY . /app WORKDIR /app RUN bundle install CMD ["rails", "server", "-b", "0.0.0.0"]
| Pattern | Image Size | Startup Time | Resource Usage | Verdict |
|---|---|---|---|---|
| Full Ruby image with all packages | Large (700MB+) | Slow (10+ sec) | High CPU & Memory | [X] Bad |
| Slim Ruby image with cached dependencies | Smaller (400MB) | Faster (5 sec) | Lower CPU & Memory | [OK] Good |