containers-geminabox/Dockerfile

44 lines
1.3 KiB
Text
Raw Normal View History

2021-10-03 23:19:00 +00:00
ARG ALPINE_VERSION=3.13.6
ARG RUBY_VERSION=2.7
ARG RUBY_PATCH=5
ARG BASE_IMAGE=registry.nulo.in/sutty/ruby
FROM ${BASE_IMAGE}:${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH}
ARG ALPINE_VERSION
ARG NIO4R_VERSION=2.5.8
ARG PUMA_VERSION=5.6.2
ARG HIREDIS_VERSION=0.6.3
2019-09-10 23:10:18 +00:00
MAINTAINER "f <f@sutty.nl>"
2019-09-18 01:01:34 +00:00
ENV RACK_ENV=production
ENV REDIS_SERVER=redis://redis:6379/2
2019-09-18 01:01:34 +00:00
RUN getent group 82 || addgroup -g 82 -S www-data
RUN adduser -s /bin/sh -G www-data -h /srv -D ruby
RUN install -dm 2750 -o ruby -g www-data /srv/gems
2019-09-18 01:01:34 +00:00
2020-09-12 15:05:00 +00:00
RUN apk add --no-cache daemonize
2020-09-12 15:18:45 +00:00
USER ruby
WORKDIR /srv
COPY --chown=ruby:www-data ./Gemfile .
COPY --chown=ruby:www-data ./config.ru .
COPY --chown=ruby:www-data ./${ALPINE_VERSION}/nio4r-${NIO4R_VERSION}-x86_64-linux-musl.gem .
COPY --chown=ruby:www-data ./${ALPINE_VERSION}/puma-${PUMA_VERSION}-x86_64-linux-musl.gem .
COPY --chown=ruby:www-data ./${ALPINE_VERSION}/hiredis-${HIREDIS_VERSION}-x86_64-linux-musl.gem .
2019-09-18 01:01:34 +00:00
# Bootstrap
RUN gem install --no-document --user-install \
./nio4r-${NIO4R_VERSION}-x86_64-linux-musl.gem \
./puma-${PUMA_VERSION}-x86_64-linux-musl.gem \
./hiredis-${HIREDIS_VERSION}-x86_64-linux-musl.gem
RUN bundle install --no-cache --clean --path ~/.gem
2020-09-12 15:18:45 +00:00
COPY ./monit.conf /etc/monit.d/geminabox.conf
COPY ./geminabox.sh /usr/local/bin/geminabox
2019-09-18 16:56:54 +00:00
2020-09-12 15:18:45 +00:00
USER root
2019-09-18 01:01:34 +00:00
EXPOSE 9292
2019-09-18 13:19:36 +00:00
VOLUME /srv/gems