dockerfiles/unmaintained/mastodon/Dockerfile.stable

94 lines
2.4 KiB
Docker
Raw Normal View History

2017-06-13 23:05:23 +02:00
FROM alpine:3.6
2017-09-10 16:36:51 +02:00
ARG VERSION=v1.6.0
2017-06-13 23:05:23 +02:00
ARG REPOSITORY=tootsuite/mastodon
2017-08-03 02:04:20 +02:00
ARG LIBICONV_VERSION=1.15
2017-06-13 23:05:23 +02:00
ENV UID=991 GID=991 \
RUN_DB_MIGRATIONS=true \
SIDEKIQ_WORKERS=5 \
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
WORKDIR /mastodon
2017-08-03 02:04:20 +02:00
# Install dependencies
2017-06-13 23:05:23 +02:00
RUN apk -U upgrade \
&& apk add \
ca-certificates \
ffmpeg \
file \
git \
2017-08-01 18:42:46 +02:00
icu-libs \
2017-06-13 23:05:23 +02:00
imagemagick \
2017-08-01 18:42:46 +02:00
libidn \
2017-06-13 23:05:23 +02:00
libpq \
libressl \
nodejs-current-npm \
nodejs-current \
protobuf \
ruby \
ruby-bigdecimal \
ruby-io-console \
ruby-irb \
ruby-json \
s6 \
su-exec \
2017-08-03 02:04:20 +02:00
# Install build dependencies
2017-06-13 23:05:23 +02:00
&& apk add -t build-dependencies \
build-base \
2017-08-01 18:42:46 +02:00
icu-dev \
2017-06-13 23:05:23 +02:00
libffi-dev \
2017-08-01 18:42:46 +02:00
libidn-dev \
2017-08-26 13:22:31 +02:00
libtool \
2017-06-13 23:05:23 +02:00
postgresql-dev \
protobuf-dev \
python \
ruby-dev \
ruby-rdoc \
tar \
2017-08-03 02:04:20 +02:00
yarn \
# Update CA certificates
2017-06-13 23:05:23 +02:00
&& update-ca-certificates \
2017-08-03 02:04:20 +02:00
# Install GNU Libiconv
&& wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${LIBICONV_VERSION}.tar.gz -O /tmp/libiconv-${LIBICONV_VERSION}.tar.gz \
2017-08-07 18:52:53 +02:00
&& mkdir /tmp/src && tar xzf /tmp/libiconv-${LIBICONV_VERSION}.tar.gz -C /tmp/src \
&& cd /tmp/src/libiconv-${LIBICONV_VERSION} \
2017-08-03 02:04:20 +02:00
&& ./configure --prefix=/usr/local \
&& make -j$(getconf _NPROCESSORS_ONLN) && make install && libtool --finish /usr/local/lib \
2017-08-03 02:04:20 +02:00
# Install Mastodon
&& cd /mastodon \
2017-06-13 23:05:23 +02:00
&& wget -qO- https://github.com/${REPOSITORY}/archive/${VERSION}.tar.gz | tar xz --strip 1 \
&& gem install bundler \
&& bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --clean --no-cache --without test development \
2017-06-13 23:05:23 +02:00
&& yarn --ignore-optional --pure-lockfile \
2017-08-03 02:04:20 +02:00
# Precompile Mastodon assets
2017-08-01 18:42:46 +02:00
&& SECRET_KEY_BASE=$(rake secret) SMTP_FROM_ADDRESS= rake assets:precompile \
2017-06-13 23:05:23 +02:00
&& mv public/assets /tmp/assets && mv public/packs /tmp/packs \
2017-08-03 02:04:20 +02:00
# Clean
&& npm -g cache clean && yarn cache clean \
2017-06-13 23:05:23 +02:00
&& apk del build-dependencies \
2017-08-03 02:08:49 +02:00
&& rm -rf /var/cache/apk/* /tmp/src
2017-06-13 23:05:23 +02:00
COPY rootfs /
RUN chmod +x /usr/local/bin/* /etc/s6.d/*/* /etc/s6.d/.s6-svscan/*
VOLUME /mastodon/public/system /mastodon/public/assets /mastodon/public/packs /mastodon/log
EXPOSE 3000 4000
LABEL maintainer="Wonderfall <wonderfall@targaryen.house>" \
description="A GNU Social-compatible microblogging server"
ENTRYPOINT ["/usr/local/bin/run"]
CMD ["/bin/s6-svscan", "/etc/s6.d"]