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 FROM ruby:2.7.3-alpine3.13
ARG VERSION=v3.3.0 ARG VERSION=main
ARG REPOSITORY=tootsuite/mastodon ARG REPOSITORY=tootsuite/mastodon
ARG LIBICONV_VERSION=1.16 ARG LIBICONV_VERSION=1.16
ARG NODE_VERSION=14.16.1
ENV UID=991 GID=991 \ ENV UID=991 GID=991 \
RUN_DB_MIGRATIONS=true \ RUN_DB_MIGRATIONS=true \
@ -11,12 +12,14 @@ ENV UID=991 GID=991 \
RAILS_SERVE_STATIC_FILES=true \ RAILS_SERVE_STATIC_FILES=true \
RAILS_ENV=production \ RAILS_ENV=production \
NODE_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 WORKDIR /mastodon
# Install dependencies # 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 \ && apk add \
ca-certificates \ ca-certificates \
ffmpeg \ ffmpeg \
@ -28,8 +31,6 @@ RUN apk -U upgrade \
libxml2 \ libxml2 \
libxslt \ libxslt \
libpq \ libpq \
nodejs \
npm \
openssl \ openssl \
protobuf \ protobuf \
s6 \ s6 \
@ -50,8 +51,6 @@ RUN apk -U upgrade \
postgresql-dev \ postgresql-dev \
protobuf-dev \ protobuf-dev \
python3 \ python3 \
tar \
yarn \
# Update CA certificates # Update CA certificates
&& update-ca-certificates \ && update-ca-certificates \
@ -67,7 +66,9 @@ RUN apk -U upgrade \
&& cd /mastodon \ && cd /mastodon \
&& wget -qO- https://github.com/${REPOSITORY}/archive/${VERSION}.tar.gz | tar xz --strip 1 \ && 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 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 \ && yarn install --pure-lockfile --ignore-engines \
# Precompile Mastodon assets # Precompile Mastodon assets

View file

@ -2,6 +2,8 @@
A GNU Social-compatible microblogging server : https://github.com/tootsuite/mastodon 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? #### 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. 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 #!/bin/sh
cd /mastodon 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