From fe1c4ef7fc316ae9c93c345956644b78d6ba7f07 Mon Sep 17 00:00:00 2001 From: Wonderfall Date: Fri, 16 Apr 2021 00:12:39 +0200 Subject: [PATCH] update to main for now --- Dockerfile | 17 +++++++++-------- README.md | 2 ++ rootfs/etc/s6.d/sidekiq/run | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2085583..7890188 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index f289582..ae3c0a9 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/rootfs/etc/s6.d/sidekiq/run b/rootfs/etc/s6.d/sidekiq/run index ff6aac6..29b4e37 100644 --- a/rootfs/etc/s6.d/sidekiq/run +++ b/rootfs/etc/s6.d/sidekiq/run @@ -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