Pleroma + :whale: = :heart:
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.

Dockerfile 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. FROM alpine:3.9
  2. # Set up environment
  3. ENV LC_ALL=C.UTF-8
  4. ENV LANG=C.UTF-8
  5. ENV MIX_ENV=prod
  6. # Prepare mounts
  7. VOLUME /custom.d
  8. # Expose default pleroma port to host
  9. EXPOSE 4000
  10. # Get dependencies
  11. RUN \
  12. apk add --no-cache --virtual .tools \
  13. git curl rsync postgresql-client \
  14. \
  15. && apk add --no-cache --virtual .sdk \
  16. build-base \
  17. \
  18. && apk add --no-cache --virtual .runtime \
  19. imagemagick erlang erlang-runtime-tools erlang-xmerl erlang-ssl erlang-eldap elixir
  20. # Add entrypoint
  21. COPY ./entrypoint.sh /
  22. RUN chmod a+x /entrypoint.sh
  23. ENTRYPOINT ["/entrypoint.sh"]
  24. # Limit permissions
  25. ARG DOCKER_UID=1000
  26. ARG DOCKER_GID=1000
  27. ARG PLEROMA_UPLOADS_PATH=/uploads
  28. RUN \
  29. addgroup -g ${DOCKER_GID} pleroma \
  30. && adduser -S -s /bin/ash -G pleroma -u ${DOCKER_UID} pleroma \
  31. && mkdir -p /custom.d $PLEROMA_UPLOADS_PATH \
  32. && chown -R pleroma:pleroma /custom.d $PLEROMA_UPLOADS_PATH
  33. USER pleroma
  34. WORKDIR /home/pleroma
  35. # Get pleroma sources
  36. RUN git clone --progress https://git.pleroma.social/pleroma/pleroma.git ./pleroma
  37. WORKDIR /home/pleroma/pleroma
  38. # Bust the build cache (if needed)
  39. # This works by setting an environment variable with the last
  40. # used version/branch/tag/commitish/... which originates in the script.
  41. # If the host doesn't have the required tool for "smart version detection"
  42. # we'll just use the current timestamp here which forces a rebuild every time.
  43. ARG __CACHE_TAG
  44. ENV __CACHE_TAG $__CACHE_TAG
  45. # Fetch changes, checkout
  46. ARG PLEROMA_VERSION
  47. RUN \
  48. git fetch --all \
  49. && git checkout $PLEROMA_VERSION \
  50. && git pull --rebase --autostash
  51. # Precompile
  52. RUN \
  53. cp ./config/dev.exs ./config/prod.secret.exs \
  54. && BUILDTIME=1 /entrypoint.sh \
  55. && rm ./config/prod.secret.exs
  56. # Insert overrides
  57. COPY --chown=pleroma:pleroma ./custom.d /home/pleroma/pleroma