闭社主体 forked from https://github.com/tootsuite/mastodon
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.

79 lines
2.3 KiB

  1. FROM ruby:2.5.0-alpine3.7
  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 YARN_VERSION=1.3.2
  8. ARG YARN_DOWNLOAD_SHA256=6cfe82e530ef0837212f13e45c1565ba53f5199eec2527b85ecbcd88bf26821d
  9. ARG LIBICONV_VERSION=1.15
  10. ARG LIBICONV_DOWNLOAD_SHA256=ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178
  11. EXPOSE 3000 4000
  12. WORKDIR /mastodon
  13. RUN apk -U upgrade \
  14. && apk add -t build-dependencies \
  15. build-base \
  16. icu-dev \
  17. libidn-dev \
  18. libressl \
  19. libtool \
  20. postgresql-dev \
  21. protobuf-dev \
  22. python \
  23. && apk add \
  24. ca-certificates \
  25. ffmpeg \
  26. file \
  27. git \
  28. icu-libs \
  29. imagemagick \
  30. libidn \
  31. libpq \
  32. nodejs \
  33. nodejs-npm \
  34. protobuf \
  35. su-exec \
  36. tini \
  37. tzdata \
  38. && update-ca-certificates \
  39. && mkdir -p /tmp/src /opt \
  40. && wget -O yarn.tar.gz "https://github.com/yarnpkg/yarn/releases/download/v$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
  41. && echo "$YARN_DOWNLOAD_SHA256 *yarn.tar.gz" | sha256sum -c - \
  42. && tar -xzf yarn.tar.gz -C /tmp/src \
  43. && rm yarn.tar.gz \
  44. && mv /tmp/src/yarn-v$YARN_VERSION /opt/yarn \
  45. && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
  46. && wget -O libiconv.tar.gz "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-$LIBICONV_VERSION.tar.gz" \
  47. && echo "$LIBICONV_DOWNLOAD_SHA256 *libiconv.tar.gz" | sha256sum -c - \
  48. && tar -xzf libiconv.tar.gz -C /tmp/src \
  49. && rm libiconv.tar.gz \
  50. && cd /tmp/src/libiconv-$LIBICONV_VERSION \
  51. && ./configure --prefix=/usr/local \
  52. && make -j$(getconf _NPROCESSORS_ONLN)\
  53. && make install \
  54. && libtool --finish /usr/local/lib \
  55. && cd /mastodon \
  56. && rm -rf /tmp/* /var/cache/apk/*
  57. COPY Gemfile Gemfile.lock package.json yarn.lock .yarnclean /mastodon/
  58. RUN bundle config build.nokogiri --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include \
  59. && bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without test development \
  60. && yarn --pure-lockfile \
  61. && yarn cache clean
  62. COPY . /mastodon
  63. COPY docker_entrypoint.sh /usr/local/bin/run
  64. RUN chmod +x /usr/local/bin/run
  65. VOLUME /mastodon/public/system /mastodon/public/assets /mastodon/public/packs
  66. ENTRYPOINT ["/usr/local/bin/run"]