Commit 046787a1 authored by zauberstuhl's avatar zauberstuhl

Update mastodon image

parent ebd4d26e
Pipeline #2334 failed with stage
in 9 minutes and 15 seconds
FROM node:8.11.3-alpine as node
FROM ruby:2.4.4-alpine3.6
LABEL maintainer="https://github.com/tootsuite/mastodon" \
description="Your self-hosted, globally interconnected microblogging community"
ARG UID=991
ARG GID=991
ENV PATH=/mastodon/bin:$PATH \
RAILS_SERVE_STATIC_FILES=true \
RAILS_ENV=production \
NODE_ENV=production
ARG LIBICONV_VERSION=1.15
ARG LIBICONV_DOWNLOAD_SHA256=ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178
EXPOSE 3000 4000
WORKDIR /mastodon
COPY --from=node /usr/local/bin/node /usr/local/bin/node
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node /usr/local/bin/npm /usr/local/bin/npm
COPY --from=node /opt/yarn-* /opt/yarn
RUN apk -U upgrade \
&& apk add -t build-dependencies \
build-base \
icu-dev \
libidn-dev \
libressl \
libtool \
postgresql-dev \
protobuf-dev \
python \
&& apk add \
ca-certificates \
ffmpeg \
file \
git \
icu-libs \
imagemagick \
libidn \
libpq \
protobuf \
tini \
tzdata \
&& update-ca-certificates \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn/bin/yarnpkg /usr/local/bin/yarnpkg \
&& mkdir -p /tmp/src /opt \
&& wget -O libiconv.tar.gz "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-$LIBICONV_VERSION.tar.gz" \
&& echo "$LIBICONV_DOWNLOAD_SHA256 *libiconv.tar.gz" | sha256sum -c - \
&& tar -xzf libiconv.tar.gz -C /tmp/src \
&& rm libiconv.tar.gz \
&& cd /tmp/src/libiconv-$LIBICONV_VERSION \
&& ./configure --prefix=/usr/local \
&& make -j$(getconf _NPROCESSORS_ONLN)\
&& make install \
&& libtool --finish /usr/local/lib \
&& cd /mastodon \
&& rm -rf /tmp/* /var/cache/apk/*
RUN addgroup -g ${GID} mastodon && adduser -h /mastodon -s /bin/sh -D -G mastodon -u ${UID} mastodon
#COPY Gemfile Gemfile.lock package.json yarn.lock .yarnclean /mastodon/
RUN git clone --depth 1 https://github.com/tootsuite/mastodon.git /mastodon
RUN mkdir -p /mastodon/public/system /mastodon/public/assets /mastodon/public/packs
RUN chown -R mastodon:mastodon /mastodon
RUN bundle config build.nokogiri --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include \
&& bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without test development \
&& yarn install --pure-lockfile --ignore-engines \
&& yarn cache clean
VOLUME /mastodon/public/system
FROM tootsuite/mastodon:v2.8.2
USER root
# XXX workaround for ruby goldfinger gem
# adds the ability to search profiles via http
# (see https://github.com/tootsuite/goldfinger/pull/2)
RUN sed -i 's/https/http/' $(bundle show goldfinger)/lib/goldfinger/client.rb
USER mastodon
RUN OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder bundle exec rails assets:precompile
# XXX disable redis; redis received all jobs but
# didn't execute them. bypassing it now till
# someone with more knowledge comes around
......@@ -92,7 +15,7 @@ RUN echo -e "if Rails.env.development?\n"\
"Sidekiq::Testing.inline!\n"\
"end" >> config/initializers/sidekiq.rb
COPY .env /mastodon/.env
COPY .env /opt/mastodon/.env
COPY start.sh /start.sh
CMD ["/bin/bash", "/start.sh"]
......@@ -2,9 +2,9 @@
WEBPACK_PORT=$(($PORT+100))
sed -i "s/APP_PORT/$PORT/" /mastodon/.env
sed -i "s/DATABASE_NAME/$DATABASE/" /mastodon/.env
sed -i "s/LOCALHOST/$(hostname -i)/" /mastodon/.env
sed -i "s/APP_PORT/$PORT/" .env
sed -i "s/DATABASE_NAME/$DATABASE/" .env
sed -i "s/LOCALHOST/$(hostname -i)/" .env
sed -i "s/port: 3035/port: $WEBPACK_PORT/" config/webpacker.yml
./bin/webpack-dev-server --port $WEBPACK_PORT &
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment