update to main for now

This commit is contained in:
Wonderfall 2021-04-16 00:12:39 +02:00
parent 46c0213ed0
commit fe1c4ef7fc
3 changed files with 12 additions and 9 deletions

View file

@ -1,8 +1,9 @@
FROM ruby:2.7.3-alpine3.13
ARG VERSION=v3.3.0
ARG VERSION=main
ARG REPOSITORY=tootsuite/mastodon
ARG LIBICONV_VERSION=1.16
ARG NODE_VERSION=14.16.1
ENV UID=991 GID=991 \
RUN_DB_MIGRATIONS=true \
@ -11,12 +12,14 @@ ENV UID=991 GID=991 \
RAILS_SERVE_STATIC_FILES=true \
RAILS_ENV=production \
NODE_ENV=production \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/mastodon/bin
PATH="${PATH}:/opt/node/bin:/mastodon/bin"
WORKDIR /mastodon
# Install dependencies
RUN apk -U upgrade \
RUN wget -q https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64-musl.tar.xz \
&& mkdir /opt/node && tar -Jxf node-v$NODE_VERSION-linux-x64-musl.tar.xz -C /opt/node --strip-components 1 \
&& apk -U upgrade \
&& apk add \
ca-certificates \
ffmpeg \
@ -28,8 +31,6 @@ RUN apk -U upgrade \
libxml2 \
libxslt \
libpq \
nodejs \
npm \
openssl \
protobuf \
s6 \
@ -50,8 +51,6 @@ RUN apk -U upgrade \
postgresql-dev \
protobuf-dev \
python3 \
tar \
yarn \
# Update CA certificates
&& update-ca-certificates \
@ -67,7 +66,9 @@ RUN apk -U upgrade \
&& cd /mastodon \
&& wget -qO- https://github.com/${REPOSITORY}/archive/${VERSION}.tar.gz | tar xz --strip 1 \
&& bundle config build.nokogiri --use-system-libraries --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include \
&& bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --clean --no-cache --without test development \
&& bundle config set --local clean 'true' && bundle config set --local deployment 'true' && bundle config set --local without 'test development' \
&& bundle install -j$(getconf _NPROCESSORS_ONLN) --no-cache \
&& npm install -g yarn \
&& yarn install --pure-lockfile --ignore-engines \
# Precompile Mastodon assets

View file

@ -2,6 +2,8 @@
A GNU Social-compatible microblogging server : https://github.com/tootsuite/mastodon
Note (Apr. 2021): currently Mastodon "stable" can't be built beacause of some [yanked packages](https://github.com/tootsuite/mastodon/issues/15986). Not only that, but the streaming component refuses to work correctly with node v14. This is fixed in main.
#### Why this image?
This image is not the official one. The main difference you can notice is that all processes (web, streaming, sidekiq) are running in a single container, thanks to s6 (a supervision suite). Therefore it's easier to deploy, but not recommended for scaling.

View file

@ -1,3 +1,3 @@
#!/bin/sh
cd /mastodon
exec bundle exec sidekiq -c $SIDEKIQ_WORKERS -q default -q push -q pull -q mailers > ./log/sidekiq.log 2>&1
exec bundle exec sidekiq -c $SIDEKIQ_WORKERS -q default -q push -q pull -q scheduler -q mailers > ./log/sidekiq.log 2>&1