dockerfiles/mastodon/Dockerfile.master

77 lines
1.9 KiB
Docker
Raw Normal View History

2017-06-13 23:05:23 +02:00
FROM alpine:3.6
ARG VERSION=master
ARG REPOSITORY=tootsuite/mastodon
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
RUN apk -U upgrade \
&& apk add \
ca-certificates \
ffmpeg \
file \
git \
2017-07-14 05:54:27 +02:00
icu-libs \
2017-06-13 23:05:23 +02:00
imagemagick \
2017-07-17 07:07:54 +02:00
libidn \
2017-06-13 23:05:23 +02:00
libpq \
libressl \
libxml2 \
libxslt \
nodejs-current-npm \
nodejs-current \
protobuf \
ruby \
ruby-bigdecimal \
ruby-io-console \
ruby-irb \
ruby-json \
s6 \
su-exec \
&& apk add -t build-dependencies \
build-base \
2017-07-14 05:54:27 +02:00
icu-dev \
2017-06-13 23:05:23 +02:00
libffi-dev \
2017-07-17 07:07:54 +02:00
libidn-dev \
2017-06-13 23:05:23 +02:00
libxml2-dev \
libxslt-dev \
postgresql-dev \
protobuf-dev \
python \
ruby-dev \
ruby-rdoc \
tar \
&& update-ca-certificates \
&& wget -qO- https://github.com/${REPOSITORY}/archive/${VERSION}.tar.gz | tar xz --strip 1 \
&& gem install bundler \
&& bundle install --deployment --clean --no-cache --without test development \
&& npm install -g npm@3 && npm install -g yarn \
&& yarn --ignore-optional --pure-lockfile \
2017-07-14 05:54:27 +02:00
&& SECRET_KEY_BASE=$(rake secret) SMTP_FROM_ADDRESS= rake assets:precompile \
2017-06-13 23:05:23 +02:00
&& npm -g cache clean && yarn cache clean \
&& mv public/assets /tmp/assets && mv public/packs /tmp/packs \
&& apk del build-dependencies \
2017-06-16 01:52:18 +02:00
&& rm -rf /var/cache/apk/*
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"]