FROM registry.nulo.in/sutty/rails:3.13.6-2.7.5 AS build MAINTAINER "f " ARG BRANCH ENV BRANCH=$BRANCH RUN apk add --no-cache libxslt libxml2 tzdata postgresql-libs git yarn brotli libssh2 python3 findutils USER rails WORKDIR /srv/gems COPY --chown=rails:www-data ./Gemfile . COPY --chown=rails:www-data ./Gemfile.lock . RUN bundle config set no-cache true RUN bundle config set specific_platform true RUN bundle install --path=./vendor --without='test development' COPY --chown=rails:www-data ./.git/ ./.git/ RUN cd .. && git clone sutty checkout RUN cd ../checkout && git checkout $BRANCH WORKDIR /srv/checkout RUN rm -rf ./vendor ./node_modules ./tmp/cache ./.git ./test ./doc RUN mv ../gems/vendor ./vendor RUN mv ../gems/.bundle ./.bundle RUN find /srv/checkout/vendor/ruby/2.7.0 -maxdepth 3 -type d -name test -o -name spec -o -name rubocop | xargs -r rm -rf FROM registry.nulo.in/sutty/rails:3.13.6-2.7.5 ENV RAILS_ENV production # Pandoc RUN echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories # Instalar las dependencias, separamos la librería de base de datos para # poder reutilizar este primer paso desde otros contenedores # # Necesitamos yarn para que Jekyll pueda generar los sitios # XXX: Eliminarlo cuando extraigamos la generación de sitios del proceso # principal RUN apk add --no-cache libxslt libxml2 postgresql-libs libssh2 file \ rsync git jpegoptim vips ffmpeg imagemagick pandoc tectonic \ oxipng git-lfs openssh-client patch yarn daemonize ruby-webrick RUN gem install --no-document --no-user-install foreman USER rails RUN rm -rf /srv COPY --from=build --chown=rails:www-data /srv/checkout /srv RUN rm -rf /srv/http/_sites /srv/http/_deploy RUN ln -s data/_storage /srv/http/_storage RUN ln -s data/_sites /srv/http/_sites RUN ln -s data/_deploy /srv/http/_deploy RUN ln -s data/_private /srv/http/_private USER root RUN install -m 640 -o root -g root /srv/monit.conf /etc/monit.d/sutty.conf RUN install -m 755 /srv/entrypoint.sh /usr/local/bin/sutty VOLUME "/srv/data" EXPOSE 3000 EXPOSE 9394