2019-09-18 01:01:34 +00:00
|
|
|
FROM sutty/sdk-ruby:latest AS build
|
2019-09-10 23:10:18 +00:00
|
|
|
MAINTAINER "f <f@sutty.nl>"
|
2019-09-18 01:01:34 +00:00
|
|
|
|
|
|
|
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/http/geminabox
|
|
|
|
RUN chmod 755 /usr/local/bin/geminabox
|
|
|
|
|
|
|
|
EXPOSE 9292
|
|
|
|
VOLUME /srv/http/geminabox
|