From 20c72a1f59efb5b9d21f13679c56759f7139be8c Mon Sep 17 00:00:00 2001 From: Samuel Cooper Date: Fri, 13 Apr 2018 23:29:26 +0200 Subject: [PATCH 1/6] Amend TODO --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 31d77e3..7b07489 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,4 @@ This image is intended exclusively for development. - Control migrations and bundle installing more intuitively - Create external script for controlling/handling the setup +- RVM env with proper commands (`rvm gemset create 2.4@diaspora && rvm ruby-2.4@diaspora do gem install bundler`) instead of building a "skeleton" by hand From d9f76ee0a828d978f42badffe4cfee70a17d9ea8 Mon Sep 17 00:00:00 2001 From: Samuel Cooper Date: Fri, 13 Apr 2018 23:39:23 +0200 Subject: [PATCH 2/6] Add link to readme todo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b07489..b18cd2b 100644 --- a/README.md +++ b/README.md @@ -17,4 +17,4 @@ This image is intended exclusively for development. - Control migrations and bundle installing more intuitively - Create external script for controlling/handling the setup -- RVM env with proper commands (`rvm gemset create 2.4@diaspora && rvm ruby-2.4@diaspora do gem install bundler`) instead of building a "skeleton" by hand +- RVM env with proper commands (`rvm gemset create 2.4@diaspora && rvm ruby-2.4@diaspora do gem install bundler`) instead of building a "skeleton" by hand (see also https://github.com/SuperTux88/diaspora-formula/blob/master/diaspora/install.sls) From cadeebdeb46241e771de10a72606a1ce1543c213 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sat, 14 Apr 2018 02:47:55 +0200 Subject: [PATCH 3/6] Use ruby-slim-stretch as base instead of rvm --- Dockerfile.diaspora | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/Dockerfile.diaspora b/Dockerfile.diaspora index 3322c94..35e909c 100644 --- a/Dockerfile.diaspora +++ b/Dockerfile.diaspora @@ -1,4 +1,4 @@ -FROM debian:stretch as base +FROM ruby:2.4.4-slim-stretch ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update \ @@ -16,20 +16,6 @@ RUN apt-get update \ libpq-dev \ cmake \ nodejs \ - # Packages for RVM - gawk \ - libyaml-dev \ - libsqlite3-dev \ - sqlite3 \ - autoconf \ - libgmp-dev \ - libgdbm-dev \ - libncurses5-dev \ - automake \ - bison \ - libffi-dev \ - libgmp-dev \ - libreadline-dev \ && rm -rf /var/lib/apt/lists/* ARG EXT_UID @@ -41,24 +27,6 @@ USER diaspora RUN mkdir /home/diaspora/diaspora WORKDIR /home/diaspora/diaspora -# Install RVM + Ruby -ENV LANG=C.UTF8 - -RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import - \ - && curl -L https://s.diaspora.software/1t | bash \ - && rm -rf ~/.gnupg -SHELL ["/bin/bash", "--login", "-c"] - -RUN rvm install 2.4 - -# Install bundler -RUN echo diaspora > .ruby-gemset \ - && echo 2.4 > .ruby-version \ - && touch Gemfile \ - && cd ../diaspora \ - && gem install bundler \ - && rm .ruby-* Gemfile - # Finish setup COPY ./start.sh ../start.sh From 35479aebb59b918573119e6bf83fcd5bfdedac51 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sat, 14 Apr 2018 03:02:23 +0200 Subject: [PATCH 4/6] Add diaspora.docker to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4c49bd7..8dfd6db 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .env +diaspora.docker From 7b1488be9017e4e6fa65dbb580360ad58dd4e1fc Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sat, 14 Apr 2018 03:08:36 +0200 Subject: [PATCH 5/6] Add libidn11-dev as new dependency after recent gem updates --- Dockerfile.diaspora | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile.diaspora b/Dockerfile.diaspora index 35e909c..2eea43b 100644 --- a/Dockerfile.diaspora +++ b/Dockerfile.diaspora @@ -6,6 +6,7 @@ RUN apt-get update \ build-essential \ libssl-dev \ libcurl4-openssl-dev \ + libidn11-dev \ libxml2-dev \ libxslt-dev \ imagemagick \ From 7684ff0075e58235e5b5215a38637f9f1e5e13ab Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sat, 14 Apr 2018 04:28:54 +0200 Subject: [PATCH 6/6] Override BUNDLE_PATH from ruby-slim-stretch --- Dockerfile.diaspora | 11 +++++++++-- start.sh | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile.diaspora b/Dockerfile.diaspora index 2eea43b..806cabe 100644 --- a/Dockerfile.diaspora +++ b/Dockerfile.diaspora @@ -25,8 +25,15 @@ RUN addgroup --system --gid ${EXT_GID} diaspora RUN adduser --system --uid ${EXT_UID} --gid ${EXT_GID} diaspora USER diaspora -RUN mkdir /home/diaspora/diaspora -WORKDIR /home/diaspora/diaspora +ENV DIASPORA_HOME /home/diaspora/diaspora +RUN mkdir $DIASPORA_HOME +WORKDIR $DIASPORA_HOME + +ENV GEM_HOME $DIASPORA_HOME/vendor/bundle +ENV BUNDLE_PATH="$GEM_HOME" \ + BUNDLE_BIN="$GEM_HOME/bin" \ + BUNDLE_APP_CONFIG="$DIASPORA_HOME/.bundle" +ENV PATH $BUNDLE_BIN:$PATH # Finish setup COPY ./start.sh ../start.sh diff --git a/start.sh b/start.sh index b46356e..d34f6c4 100755 --- a/start.sh +++ b/start.sh @@ -2,7 +2,6 @@ action_install_gems() { script/configure_bundler - bin/bundle config --local path vendor/bundle bin/bundle install --full-index }