You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.8 KiB

  1. FROM ruby:2.4.2-alpine3.6
  2. LABEL maintainer="https://github.com/tootsuite/mastodon" \
  3. description="A GNU Social-compatible microblogging server"
  4. ENV UID=991 GID=991 \
  5. RAILS_SERVE_STATIC_FILES=true \
  6. RAILS_ENV=production NODE_ENV=production
  7. ARG LIBICONV_VERSION=1.15
  8. ARG LIBICONV_DOWNLOAD_SHA256=ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178
  9. EXPOSE 3000 4000
  10. WORKDIR /mastodon
  11. RUN apk -U upgrade \
  12. && apk add -t build-dependencies \
  13. build-base \
  14. icu-dev \
  15. libidn-dev \
  16. libtool \
  17. postgresql-dev \
  18. protobuf-dev \
  19. python \
  20. && apk add \
  21. ca-certificates \
  22. ffmpeg \
  23. file \
  24. git \
  25. icu-libs \
  26. imagemagick \
  27. libidn \
  28. libpq \
  29. nodejs-npm \
  30. nodejs \
  31. protobuf \
  32. su-exec \
  33. tini \
  34. yarn \
  35. && update-ca-certificates \
  36. && wget -O libiconv.tar.gz "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-$LIBICONV_VERSION.tar.gz" \
  37. && echo "$LIBICONV_DOWNLOAD_SHA256 *libiconv.tar.gz" | sha256sum -c - \
  38. && mkdir -p /tmp/src \
  39. && tar -xzf libiconv.tar.gz -C /tmp/src \
  40. && rm libiconv.tar.gz \
  41. && cd /tmp/src/libiconv-$LIBICONV_VERSION \
  42. && ./configure --prefix=/usr/local \
  43. && make -j$(getconf _NPROCESSORS_ONLN)\
  44. && make install \
  45. && libtool --finish /usr/local/lib \
  46. && cd /mastodon \
  47. && rm -rf /tmp/* /var/cache/apk/*
  48. COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/
  49. RUN bundle config build.nokogiri --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include \
  50. && bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without test development \
  51. && yarn --ignore-optional --pure-lockfile
  52. COPY . /mastodon
  53. COPY docker_entrypoint.sh /usr/local/bin/run
  54. RUN chmod +x /usr/local/bin/run
  55. VOLUME /mastodon/public/system /mastodon/public/assets /mastodon/public/packs
  56. ENTRYPOINT ["/usr/local/bin/run"]