diff --git a/.gitignore b/.gitignore index 4c49bd7..8dfd6db 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .env +diaspora.docker diff --git a/Dockerfile.diaspora b/Dockerfile.diaspora index 3322c94..806cabe 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 \ @@ -6,6 +6,7 @@ RUN apt-get update \ build-essential \ libssl-dev \ libcurl4-openssl-dev \ + libidn11-dev \ libxml2-dev \ libxslt-dev \ imagemagick \ @@ -16,20 +17,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 @@ -38,26 +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 - -# 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 +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/README.md b/README.md index 31d77e3..b18cd2b 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 (see also https://github.com/SuperTux88/diaspora-formula/blob/master/diaspora/install.sls) 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 }