From 707c53a037d690641359be42a55ff4671ac1e085 Mon Sep 17 00:00:00 2001
From: Andrej Shadura <andrew.shadura@collabora.co.uk>
Date: Tue, 12 Apr 2022 10:15:51 +0200
Subject: [PATCH] Instead of patching Gemfile with sed, move puma to prod+dev
 group

Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
---
 Dockerfile.frontend | 6 ------
 src/api/Gemfile     | 4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/Dockerfile.frontend b/Dockerfile.frontend
index 801810af99..044caa608c 100644
--- a/Dockerfile.frontend
+++ b/Dockerfile.frontend
@@ -15,12 +15,6 @@ RUN mkdir -p log tmp db/sphinx \
 
 ADD --chown=frontend:frontend src/api/ $INSTALLDIR/src/api/
 
-# Move Puma from development section to production
-RUN sed -e "/gem 'puma'/d" Gemfile > Gemfile.new; \
-    echo "gem 'puma'" >> Gemfile.new; \
-    diff -u Gemfile Gemfile.new; \
-    mv Gemfile.new Gemfile
-
 # The base image only has runtime dependencies, Gemfiles and pre-built assets
 # The assets and the Gemfile.lock have been overwritten by the ADD command above, restore them.
 COPY --from=base $INSTALLDIR/src/api/Gemfile.lock  $INSTALLDIR/src/api/
diff --git a/src/api/Gemfile b/src/api/Gemfile
index 5b38df49d8..c1a70df6ec 100644
--- a/src/api/Gemfile
+++ b/src/api/Gemfile
@@ -98,6 +98,8 @@ group :development, :production do
   gem 'ruby-ldap', require: false
   # to have better logs
   gem 'lograge'
+  # Use Puma as the app server (rails 5 default)
+  gem 'puma', '~> 4.0'
 end
 
 group :production do
@@ -175,8 +177,6 @@ group :development, :test do
   gem 'single_test'
   # to find n+1 queries
   gem 'bullet'
-  # Use Puma as the app server (rails 5 default)
-  gem 'puma', '~> 4.0'
   # to drive headless chrome
   gem 'selenium-webdriver'
   # scan for security vulnerability (circleci only, do not touch)
-- 
GitLab