containers-geminabox/Dockerfile

35 lines
1 KiB
Text
Raw Normal View History

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
2019-12-20 21:49:10 +00:00
ENV RACK_ENV=production
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
2019-12-20 21:49:10 +00:00
FROM sutty/monit:latest
2019-09-18 01:01:34 +00:00
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
2020-09-12 15:05:00 +00:00
RUN apk add --no-cache daemonize
2019-09-18 01:01:34 +00:00
COPY ./monit.conf /etc/monit.d/geminabox.conf
COPY ./geminabox.sh /usr/local/bin/geminabox
COPY --from=build /srv/http /srv/http
2019-09-18 13:19:36 +00:00
RUN install -dm 2750 -o app -g www-data /srv/gems
2019-09-18 01:01:34 +00:00
RUN chmod 755 /usr/local/bin/geminabox
2019-09-18 16:56:54 +00:00
# https://github.com/rubygems/rubygems/issues/2918
# https://gitlab.alpinelinux.org/alpine/aports/issues/10808
COPY ./rubygems-platform-musl.patch /tmp/
2020-09-12 15:05:00 +00:00
RUN apk add --no-cache patch && cd /usr/lib/ruby/2.7.0 && patch -Np 0 -i /tmp/rubygems-platform-musl.patch && apk del patch
2019-09-18 16:56:54 +00:00
2019-09-18 01:01:34 +00:00
EXPOSE 9292
2019-09-18 13:19:36 +00:00
VOLUME /srv/gems