Update gems and image to Ruby 2.6 + jemalloc

Update gems and image to Ruby 2.6 + jemalloc

This adds support for jemalloc, in turn it means the alpine image is a no go so we switched to the strech slim ruby image.

Dockerfile contains horrendous hack (repeat bundle install) for the life of me I can not figure out why it is required.

Switch travis to test on 2.5 and 2.6

Update all dependencies in lock file

diff --git a/.travis.yml b/.travis.yml
index 8834663..fbb7f52 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,7 +3,8 @@ sudo: false
 cache: bundler
 
 rvm:
-  - 2.5.3
+  - 2.5
+  - 2.6
 
 gemfile:
   - Gemfile
diff --git a/Dockerfile b/Dockerfile
index e377ce5..8837e8e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,29 +1,35 @@
-FROM ruby:2.5-alpine
+FROM ruby:2.6.1-slim-stretch
 
 MAINTAINER Matt Palmer "matt.palmer@discourse.org"
 
+RUN useradd mobystash -s /bin/bash -m -U --create-home
 COPY Gemfile Gemfile.lock /home/mobystash/
 
-RUN adduser -D mobystash \
-	&& docker_group="$(getent group 999 | cut -d : -f 1)" \
-	&& if [ -z "$docker_group" ]; then addgroup -g 999 docker; docker_group=docker; fi \
-	&& addgroup mobystash "$docker_group" \
-	&& apk update \
-	&& apk add build-base \
-	&& cd /home/mobystash \
-	&& su -pc 'bundle install --deployment --without development' mobystash \
-	&& apk del build-base \
-	&& rm -rf /tmp/* /var/cache/apk/*
-
 ARG GIT_REVISION=invalid-build
 ENV MOBYSTASH_GIT_REVISION=$GIT_REVISION
 
+RUN docker_group="$(getent group 999 | cut -d : -f 1)" \
+	&& if [ -z "$docker_group" ]; then groupadd --gid 999 docker; docker_group=docker; fi \
+	&& addgroup mobystash "$docker_group" \
+  && apt-get update \
+  && apt-get install -y libjemalloc-dev build-essential \
+  && cd /home/mobystash && su -l mobystash -c "bundle install --deployment --without development" \
+  && apt-get purge -y --auto-remove build-essential
+
 COPY bin/* /usr/local/bin/
-COPY lib/ /usr/local/lib/ruby/2.5.0/
+COPY lib/ /usr/local/lib/ruby/2.6.0/
 
 EXPOSE 9367
 LABEL org.discourse.service._prom-exp.port=9367 org.discourse.service._prom-exp.instance=mobystash org.discourse.mobystash.disable=yes
 
 USER mobystash
 WORKDIR /home/mobystash
+
+ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so
+
+# docker is just confusing me so much here, no ideal what is changing... something ...
+# this writes some file somewhere or changes a permission, but I do not know what
+# without this /usr/local/bin/mobystash no worky
+RUN bundle install --deployment --without development
+
 ENTRYPOINT ["/usr/local/bin/bundle", "exec", "/usr/local/bin/mobystash"]
diff --git a/Gemfile b/Gemfile
index 5f348ea..7b029b3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,4 +1,4 @@
-ruby '> 2.3', '< 2.6'
+ruby '> 2.3', '< 2.7'
 
 source 'https://rubygems.org'
 
@@ -12,6 +12,7 @@ gem 'logstash_writer', '~> 0.0'
 gem 'murmurhash3', '~> 0.1'
 gem 'rbtrace', '~> 0.4'
 gem 'sigdump', require: 'sigdump/setup'
+
 group :development do
   gem 'byebug'
   gem 'guard-rspec'
diff --git a/Gemfile.lock b/Gemfile.lock
index a77990c..97d32bf 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,25 +1,25 @@
 GEM
   remote: https://rubygems.org/
   specs:
-    ast (2.3.0)
-    byebug (9.0.6)
-    coderay (1.1.1)
+    ast (2.4.0)
+    byebug (10.0.2)
+    coderay (1.1.2)
     deep_merge (1.2.1)
     diff-lcs (1.3)
-    docile (1.1.5)
-    docker-api (1.33.6)
-      excon (>= 0.38.0)
-      json
-    excon (0.59.0)
-    ffi (1.9.25)
+    docile (1.3.1)
+    docker-api (1.34.2)
+      excon (>= 0.47.0)
+      multi_json
+    excon (0.62.0)
+    ffi (1.10.0)
     formatador (0.2.5)
-    frankenstein (1.1.1)
+    frankenstein (1.2.0)
       prometheus-client (= 0.8.0)
       rack (~> 2.0)
-    guard (2.14.1)
+    guard (2.15.0)
       formatador (>= 0.2.4)
       listen (>= 2.7, < 4.0)
-      lumberjack (~> 1.0)
+      lumberjack (>= 1.0.12, < 2.0)
       nenv (~> 0.1)
       notiffany (~> 0.0)
       pry (>= 0.9.12)
@@ -33,83 +33,83 @@ GEM
     guard-rubocop (1.3.0)
       guard (~> 2.0)
       rubocop (~> 0.20)
+    jaro_winkler (1.5.2)
     json (2.1.0)
     listen (3.1.5)
       rb-fsevent (~> 0.9, >= 0.9.4)
       rb-inotify (~> 0.9, >= 0.9.7)
       ruby_dep (~> 1.2)
-    loggerstash (0.0.5)
+    loggerstash (0.0.8)
       logstash_writer (~> 0.0)
     logstash_writer (0.0.10)
       prometheus-client (= 0.8.0)
-    lumberjack (1.0.12)
-    method_source (0.8.2)
-    msgpack (1.2.4)
+    lumberjack (1.0.13)
+    method_source (0.9.2)
+    msgpack (1.2.6)
+    multi_json (1.13.1)
     murmurhash3 (0.1.6)
     nenv (0.3.0)
     notiffany (0.1.1)
       nenv (~> 0.1)
       shellany (~> 0.0)
-    parallel (1.12.0)
-    parser (2.4.0.0)
-      ast (~> 2.2)
-    powerpack (0.1.1)
+    optimist (3.0.0)
+    parallel (1.13.0)
+    parser (2.6.0.0)
+      ast (~> 2.4.0)
+    powerpack (0.1.2)
     prometheus-client (0.8.0)
       quantile (~> 0.2.1)
-    pry (0.10.4)
+    pry (0.12.2)
       coderay (~> 1.1.0)
-      method_source (~> 0.8.1)
-      slop (~> 3.4)
-    pry-byebug (3.4.2)
-      byebug (~> 9.0)
+      method_source (~> 0.9.0)
+    pry-byebug (3.6.0)
+      byebug (~> 10.0)
       pry (~> 0.10)
     quantile (0.2.1)
     rack (2.0.6)
-    rainbow (2.2.2)
-      rake
-    rake (12.0.0)
-    rb-fsevent (0.10.2)
-    rb-inotify (0.9.10)
-      ffi (>= 0.5.0, < 2)
-    rbtrace (0.4.10)
+    rainbow (3.0.0)
+    rake (12.3.2)
+    rb-fsevent (0.10.3)
+    rb-inotify (0.10.0)
+      ffi (~> 1.0)
+    rbtrace (0.4.11)
       ffi (>= 1.0.6)
       msgpack (>= 0.4.3)
-      trollop (>= 1.16.2)
+      optimist (>= 3.0.0)
     redcarpet (3.4.0)
-    rspec (3.6.0)
-      rspec-core (~> 3.6.0)
-      rspec-expectations (~> 3.6.0)
-      rspec-mocks (~> 3.6.0)
-    rspec-core (3.6.0)
-      rspec-support (~> 3.6.0)
-    rspec-expectations (3.6.0)
+    rspec (3.8.0)
+      rspec-core (~> 3.8.0)
+      rspec-expectations (~> 3.8.0)
+      rspec-mocks (~> 3.8.0)
+    rspec-core (3.8.0)
+      rspec-support (~> 3.8.0)
+    rspec-expectations (3.8.2)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.6.0)
-    rspec-mocks (3.6.0)
+      rspec-support (~> 3.8.0)
+    rspec-mocks (3.8.0)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.6.0)
-    rspec-support (3.6.0)
-    rubocop (0.49.1)
+      rspec-support (~> 3.8.0)
+    rspec-support (3.8.0)
+    rubocop (0.63.1)
+      jaro_winkler (~> 1.5.1)
       parallel (~> 1.10)
-      parser (>= 2.3.3.1, < 3.0)
+      parser (>= 2.5, != 2.5.1.1)
       powerpack (~> 0.1)
-      rainbow (>= 1.99.1, < 3.0)
+      rainbow (>= 2.2.2, < 4.0)
       ruby-progressbar (~> 1.7)
-      unicode-display_width (~> 1.0, >= 1.0.1)
-    ruby-progressbar (1.8.1)
+      unicode-display_width (~> 1.4.0)
+    ruby-progressbar (1.10.0)
     ruby_dep (1.5.0)
     shellany (0.0.1)
     sigdump (0.2.4)
-    simplecov (0.14.1)
-      docile (~> 1.1.0)
+    simplecov (0.16.1)
+      docile (~> 1.1)
       json (>= 1.8, < 3)
       simplecov-html (~> 0.10.0)
-    simplecov-html (0.10.1)
-    slop (3.6.0)
-    thor (0.19.4)
-    trollop (2.1.2)
-    unicode-display_width (1.3.0)
-    yard (0.9.16)
+    simplecov-html (0.10.2)
+    thor (0.20.3)
+    unicode-display_width (1.4.1)
+    yard (0.9.18)
 
 PLATFORMS
   ruby

GitHub sha: 8d5a2dd7