1 # Pleroma Docker setup taken from
2 # https://github.com/jordemort/docker-pleroma
4 FROM ubuntu:20.04 AS unzip
6 ENV DEBIAN_FRONTEND=noninteractive
8 RUN apt-get update && \
9 apt-get install -y --no-install-recommends unzip
11 # docker buildx will fill these in
15 # Clone the release build into a temporary directory and unpack it
16 # We use ADD here to bust the cache if the pleroma release changes
17 # We use a separate layer for extraction so we don't end up with junk
18 # from ADD left over in the final image.
19 ADD https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job=${TARGETARCH}${TARGETVARIANT:+${TARGETVARIANT}l} /tmp/pleroma.zip
21 RUN mkdir -p /opt/pleroma && \
22 unzip /tmp/pleroma.zip -d /tmp/ && \
23 mv /tmp/release/* /opt/pleroma
25 # Ok, really build the container now
26 FROM ubuntu:20.04 AS pleroma
28 ENV DEBIAN_FRONTEND=noninteractive
30 ARG SOAPBOXVERSION=1.2.3
32 RUN apt-get update && \
33 apt-get install -y --no-install-recommends \
34 ca-certificates curl dumb-init ffmpeg gnupg imagemagick libimage-exiftool-perl libmagic-dev libncurses5 locales postgresql-client-12 unzip && \
37 RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && \
42 ENV LC_ALL en_US.UTF-8
44 RUN mkdir -p /etc/pleroma /var/lib/pleroma/static /var/lib/pleroma/uploads && \
45 adduser --system --shell /bin/false --home /opt/pleroma --group pleroma && \
46 chown -vR pleroma /etc/pleroma /var/lib/pleroma
48 COPY --chown=pleroma:pleroma --from=unzip /opt/pleroma/ /opt/pleroma/
50 VOLUME [ "/etc/pleroma", "/var/lib/pleroma/uploads", "/var/lib/pleroma/static" ]
52 ADD https://gitlab.com/soapbox-pub/soapbox-fe/-/jobs/artifacts/v${SOAPBOXVERSION}/download?job=build-production /tmp/soapbox-fe.zip
53 RUN chown pleroma /tmp/soapbox-fe.zip
57 COPY run-pleroma.sh /opt/pleroma/bin/
59 ENTRYPOINT [ "/usr/bin/dumb-init" ]
63 ENV PATH=/opt/pleroma/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
64 ENV PLEROMA_CONFIG_PATH=/etc/pleroma/config.exs
73 CMD curl --fail http://localhost:4000/api/v1/instance || exit 1
75 CMD [ "run-pleroma.sh" ]