2017-04-10 22:47:41 +02:00
|
|
|
FROM ruby:2.4.1-alpine
|
2016-03-14 21:39:39 +01:00
|
|
|
|
2017-04-06 20:57:16 +02:00
|
|
|
LABEL maintainer="https://github.com/tootsuite/mastodon" \
|
|
|
|
description="A GNU Social-compatible microblogging server"
|
|
|
|
|
2017-05-20 15:12:29 +02:00
|
|
|
ENV UID=991 GID=991 \
|
2017-05-20 20:01:05 +02:00
|
|
|
RAILS_SERVE_STATIC_FILES=true \
|
2017-05-20 15:12:29 +02:00
|
|
|
RAILS_ENV=production NODE_ENV=production
|
2016-03-14 21:39:39 +01:00
|
|
|
|
2017-04-06 20:57:16 +02:00
|
|
|
EXPOSE 3000 4000
|
|
|
|
|
2016-03-14 21:39:39 +01:00
|
|
|
WORKDIR /mastodon
|
|
|
|
|
2017-04-16 20:28:25 +02:00
|
|
|
RUN echo "@edge https://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \
|
2017-05-20 20:01:05 +02:00
|
|
|
&& apk -U upgrade \
|
|
|
|
&& apk add -t build-dependencies \
|
|
|
|
build-base \
|
2017-07-18 15:19:49 +02:00
|
|
|
icu-dev \
|
2017-07-16 04:40:56 +02:00
|
|
|
libidn-dev \
|
2017-04-03 00:46:44 +02:00
|
|
|
libxml2-dev \
|
|
|
|
libxslt-dev \
|
2017-05-20 20:01:05 +02:00
|
|
|
postgresql-dev \
|
|
|
|
protobuf-dev \
|
2017-04-20 13:29:38 +02:00
|
|
|
python \
|
2017-05-20 20:01:05 +02:00
|
|
|
&& apk add \
|
|
|
|
ca-certificates \
|
|
|
|
ffmpeg \
|
|
|
|
file \
|
2017-05-03 02:04:16 +02:00
|
|
|
git \
|
2017-07-18 15:19:49 +02:00
|
|
|
icu-libs \
|
2017-05-20 20:01:05 +02:00
|
|
|
imagemagick@edge \
|
2017-07-16 04:40:56 +02:00
|
|
|
libidn \
|
2017-04-03 00:46:44 +02:00
|
|
|
libpq \
|
|
|
|
libxml2 \
|
|
|
|
libxslt \
|
2017-05-20 20:01:05 +02:00
|
|
|
nodejs-npm@edge \
|
|
|
|
nodejs@edge \
|
Use CLD3 (#2949)
Compact Language Detector v3 (CLD3) is the successor of CLD2, which was
used in the previous implementation. CLD3 includes improvements since CLD2,
and supports newer compilers. On the other hand, it has additional
requirements and cld3-ruby, the FFI of CLD3 for Ruby, is still new and may
be still inmature.
Though CLD3 is named after CLD2, it is implemented with a neural network
model, different from the old implementation, which is based on a Naïve
Bayesian classifier.
CLD3 supports newer compilers, such as GCC 6. CLD2 is not compatible with
GCC 6 because it assigns negative values to varibales typed unsigned.
(see internal/cld_generated_cjk_uni_prop_80.cc) The support for GCC 6 and
newer compilers are essential today, when some server operating system
such as Ubuntu Server 16.10 has GCC 6 by default.
On the one hand, CLD3 requires C++11 support. Environments with old
compilers such as Ubuntu Server 14.04 needs to update the system or install
a newer compiler.
CLD3 needs protocol buffers as a new dependency. However,it is not
considered problematic because major server operating systems, CentOS and
Ubuntu Server provide them.
The FFI cld3-ruby was written by me (Akihiko Odaki) for use in Mastodon.
It is still new and may be inmature, but confirmed to pass existing tests.
2017-05-09 19:58:03 +02:00
|
|
|
protobuf \
|
2017-05-20 15:12:29 +02:00
|
|
|
su-exec \
|
2017-05-20 20:01:05 +02:00
|
|
|
tini \
|
2017-04-03 00:46:44 +02:00
|
|
|
&& npm install -g npm@3 && npm install -g yarn \
|
2017-04-23 04:59:56 +02:00
|
|
|
&& update-ca-certificates \
|
2017-04-03 00:46:44 +02:00
|
|
|
&& rm -rf /tmp/* /var/cache/apk/*
|
2016-03-16 11:18:09 +01:00
|
|
|
|
2017-05-03 02:04:16 +02:00
|
|
|
COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/
|
|
|
|
|
|
|
|
RUN bundle install --deployment --without test development \
|
|
|
|
&& yarn --ignore-optional --pure-lockfile
|
|
|
|
|
2017-04-06 09:41:00 +02:00
|
|
|
COPY . /mastodon
|
|
|
|
|
2017-05-20 15:12:29 +02:00
|
|
|
COPY docker_entrypoint.sh /usr/local/bin/run
|
|
|
|
|
|
|
|
RUN chmod +x /usr/local/bin/run
|
|
|
|
|
2017-05-03 02:04:16 +02:00
|
|
|
VOLUME /mastodon/public/system /mastodon/public/assets /mastodon/public/packs
|
2017-05-20 15:12:29 +02:00
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/run"]
|