diff --git a/Dockerfile b/Dockerfile
index 30dfc1b5dfccc7283191691f1fa635f1d846a7e7..f7e5e4bb4c3a90a5d96ed30956ea2c517703c8c9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -59,8 +59,12 @@ RUN if [ "$DISCOURSE_ADDITIONAL_GEMS" != "" ]; then \
     fi
 
 # run bundler
-#RUN bundle install --deployment --without test --without development
-RUN bundle install --without test --without development
+# deployment mode if no new gems added, normal mode otherwise
+RUN if [ "$DISCOURSE_ADDITIONAL_GEMS" != "" ]; then \
+        bundle install --without test --without development; \
+    else \
+        bundle install --deployment --without test --without development; \
+    fi
     
 # install discourse plugins
 # assumptions: no spaces in URLs (urlencoding is a thing)