FROM sutty/sdk-ruby:latest AS build MAINTAINER "f " RUN install -dm 2750 -o app -g www-data /srv/http USER app WORKDIR /srv/http COPY --chown=app:www-data ./Gemfile . COPY --chown=app:www-data ./config.ru . RUN bundle install --path=./vendor RUN find ./vendor -name '*.so' | xargs -r strip --strip-unneeded FROM sutty/daemonize:latest AS daemonize RUN echo /home/builder/packages/home > /etc/apk/repositories RUN apk add --no-cache daemonize FROM sutty/monit ENV RACK_ENV=production RUN addgroup -g 82 -S www-data RUN adduser -s /bin/sh -G www-data -h /srv/http -D app RUN apk add --no-cache ruby ruby-bundler ruby-json COPY --from=daemonize /usr/sbin/daemonize /usr/sbin/daemonize COPY ./monit.conf /etc/monit.d/geminabox.conf COPY ./geminabox.sh /usr/local/bin/geminabox COPY --from=build /srv/http /srv/http RUN install -dm 2750 -o app -g www-data /srv/gems RUN chmod 755 /usr/local/bin/geminabox # https://github.com/rubygems/rubygems/issues/2918 # https://gitlab.alpinelinux.org/alpine/aports/issues/10808 COPY ./rubygems-platform-musl.patch /tmp/ RUN cd /usr/lib/ruby/2.5.0 && patch -Np 0 -i /tmp/rubygems-platform-musl.patch EXPOSE 9292 VOLUME /srv/gems