From 9b8c64b8703443327121148b94f80e58b9ecb83e Mon Sep 17 00:00:00 2001 From: Thomas Riboulet Date: Tue, 5 Dec 2017 09:45:14 +0100 Subject: [PATCH] migrate source Docker image to a debian based one, fixup dockerfile --- Dockerfile | 9 +++++---- hello.rb | 2 +- worker.rb | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b4e1f9..cdb1454 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,13 @@ -FROM mcansky/base_ruby:2c7652fa95a2ab9419bb85e81a7c801ca6fa65d2 +FROM ruby:2.3.5-slim + +RUN apt-get update && apt-get install -y build-essential libffi-dev libgdbm-dev libncurses5-dev libreadline-dev libssl-dev libyaml-dev zlib1g-dev curl libyaml-0-2 libxml2-dev libxslt-dev +#RUN apk --update add --virtual openssl-dev build-dependencies ruby-dev build-base # Set environment variables. ENV HOME /var/app ENV RACK_ENV production - # Define working directory. ADD . /var/app - -RUN cd /var/app; bundle install +RUN cd /var/app; bundle install --without development test CMD ["./var/app/bin/http"] diff --git a/hello.rb b/hello.rb index adea306..1ba3061 100644 --- a/hello.rb +++ b/hello.rb @@ -4,7 +4,7 @@ require 'redis' require 'sidekiq/api' require 'haml' -$redis = Redis.new +$redis = Redis.new(url: ENV['REDIS_URL']) class SimpleApp < Sinatra::Base diff --git a/worker.rb b/worker.rb index 50202d7..a83959e 100644 --- a/worker.rb +++ b/worker.rb @@ -3,7 +3,7 @@ require 'sidekiq' require 'redis' require 'sidekiq/api' -$redis = Redis.new +$redis = Redis.new(url: ENV['REDIS_URL']) class SinatraWorker include Sidekiq::Worker