From fc90dfb9c49668aa132cd0dbec7e6b4e4e0c875c Mon Sep 17 00:00:00 2001 From: Vaidas Jablonskis Date: Sat, 12 Sep 2015 20:01:45 +0100 Subject: [PATCH] Add docker file --- Dockerfile | 34 ++++++++++++++++++++++++++++++++++ script/compile_assets.sh | 10 ++++++++++ 2 files changed, 44 insertions(+) create mode 100644 Dockerfile create mode 100755 script/compile_assets.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3a7dbdf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM ubuntu:15.04 + +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update && apt-get upgrade -y && apt-get clean +RUN apt-get install -y \ + ruby \ + ruby-i18n \ + rake \ + nodejs \ + libxml2-dev \ + libxslt1-dev \ + bundler \ + git \ + libmysqlclient-dev \ + libsqlite3-dev \ + mysql-server + +WORKDIR /entrydns +COPY Gemfile.lock /entrydns/ +COPY Gemfile /entrydns/ +RUN bundle install --deployment --without development test +COPY app /entrydns/app/ +COPY config /entrydns/config/ +COPY db /entrydns/db/ +COPY lib /entrydns/lib/ +COPY log /entrydns/log/ +COPY public /entrydns/public/ +COPY script /entrydns/script/ +COPY spec /entrydns/spec/ +COPY test /entrydns/test/ +COPY vendor /entrydns/vendor/ +COPY config.ru Rakefile /entrydns/ + +RUN script/compile_assets.sh diff --git a/script/compile_assets.sh b/script/compile_assets.sh new file mode 100755 index 0000000..c2aa347 --- /dev/null +++ b/script/compile_assets.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +cp config/database.mysql.sample.yml config/database.yml +cp config/settings.sample.yml config/settings.yml +install -m 755 -o mysql -g root -d /var/run/mysqld +mysqld --skip-grant-tables & +sleep 3 +bundle exec rake RAILS_ENV=production db:create db:schema:load +bundle exec rake RAILS_ENV=production assets:precompile +killall -9 mysqld