docker-pleroma/Dockerfile

74 lines
2.1 KiB
Docker
Raw Permalink Normal View History

2021-02-02 06:19:06 +00:00
FROM ubuntu:20.04 AS unzip
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends unzip
# docker buildx will fill this in
2023-03-26 14:13:21 +00:00
ARG TARGETARCH
2021-02-02 06:19:06 +00:00
# Clone the release build into a temporary directory and unpack it
# We use ADD here to bust the cache if the pleroma release changes
# We use a separate layer for extraction so we don't end up with junk
# from ADD left over in the final image.
2023-03-26 14:13:21 +00:00
ADD https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job=amd64 /tmp/pleroma.zip
2021-02-02 06:19:06 +00:00
2023-03-26 14:13:21 +00:00
RUN mkdir -p /opt/pleroma-amd64 && \
2021-02-02 06:19:06 +00:00
unzip /tmp/pleroma.zip -d /tmp/ && \
2023-03-26 14:13:21 +00:00
mv /tmp/release/* /opt/pleroma-amd64
2021-02-02 06:19:06 +00:00
# Ok, really build the container now
FROM ubuntu:20.04 AS pleroma
2021-02-02 01:57:23 +00:00
ENV DEBIAN_FRONTEND=noninteractive
2022-04-29 20:22:43 +00:00
ARG SOAPBOXVERSION=1.3.0
2021-04-29 20:21:11 +00:00
2021-02-02 01:57:23 +00:00
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl dumb-init ffmpeg gnupg imagemagick libimage-exiftool-perl libmagic-dev libncurses5 locales postgresql-client-12 unzip && \
2021-02-02 01:57:23 +00:00
apt-get clean
2021-02-02 05:38:02 +00:00
RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
2021-02-02 01:57:23 +00:00
2021-02-02 06:19:06 +00:00
RUN mkdir -p /etc/pleroma /var/lib/pleroma/static /var/lib/pleroma/uploads && \
adduser --system --shell /bin/false --home /opt/pleroma --group pleroma && \
chown -vR pleroma /etc/pleroma /var/lib/pleroma
2021-02-02 05:38:02 +00:00
ARG TARGETARCH
2023-03-26 14:13:21 +00:00
COPY --chown=pleroma:pleroma --from=unzip /opt/pleroma-amd64/ /opt/pleroma/
2021-02-02 01:57:23 +00:00
2021-02-02 06:19:06 +00:00
VOLUME [ "/etc/pleroma", "/var/lib/pleroma/uploads", "/var/lib/pleroma/static" ]
2021-02-02 05:38:02 +00:00
2021-04-29 20:21:11 +00:00
ADD https://gitlab.com/soapbox-pub/soapbox-fe/-/jobs/artifacts/v${SOAPBOXVERSION}/download?job=build-production /tmp/soapbox-fe.zip
2021-04-29 17:04:18 +00:00
RUN chown pleroma /tmp/soapbox-fe.zip
2021-02-02 06:19:06 +00:00
USER pleroma
2021-02-02 05:38:02 +00:00
COPY *.sh /opt/pleroma/bin/
ENTRYPOINT [ "/usr/bin/dumb-init" ]
WORKDIR /opt/pleroma
ENV PATH=/opt/pleroma/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV PLEROMA_CONFIG_PATH=/etc/pleroma/config.exs
EXPOSE 4000
STOPSIGNAL SIGTERM
HEALTHCHECK \
2021-02-02 06:19:06 +00:00
--start-period=2m \
2021-02-02 05:38:02 +00:00
--interval=5m \
CMD curl --fail http://localhost:4000/api/v1/instance || exit 1
CMD [ "run-pleroma.sh" ]