pleroma/Dockerfile

62 lines
2 KiB
Docker
Raw Normal View History

2022-07-26 17:58:42 -07:00
FROM ubuntu:22.04 as build
2022-08-12 16:28:55 -07:00
ARG MIX_ENV=prod \
OAUTH_CONSUMER_STRATEGIES="twitter facebook google microsoft slack github keycloak:ueberauth_keycloak_strategy"
2022-07-26 17:58:42 -07:00
WORKDIR /src
RUN apt-get update &&\
apt-get install -y git elixir erlang-dev erlang-nox build-essential cmake libssl-dev libmagic-dev automake autoconf libncurses5-dev &&\
2022-07-26 17:58:42 -07:00
mix local.hex --force &&\
mix local.rebar --force
2022-07-26 17:58:42 -07:00
COPY . /src
2022-07-26 17:58:42 -07:00
RUN cd /src &&\
mix deps.get --only prod &&\
mkdir release &&\
mix release --path release
FROM ubuntu:22.04
ARG BUILD_DATE
ARG VCS_REF
2022-07-26 17:58:42 -07:00
ARG DEBIAN_FRONTEND="noninteractive"
ENV TZ="Etc/UTC"
2022-07-26 18:00:06 -07:00
LABEL maintainer="hello@soapbox.pub" \
2022-08-17 09:25:39 -07:00
org.opencontainers.image.title="rebased" \
org.opencontainers.image.description="Rebased" \
2022-07-26 18:00:06 -07:00
org.opencontainers.image.authors="hello@soapbox.pub" \
org.opencontainers.image.vendor="soapbox.pub" \
org.opencontainers.image.documentation="https://gitlab.com/soapbox-pub/rebased" \
org.opencontainers.image.licenses="AGPL-3.0" \
2022-07-26 18:00:06 -07:00
org.opencontainers.image.url="https://soapbox.pub" \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.created=$BUILD_DATE
ARG HOME=/opt/pleroma
ARG DATA=/var/lib/pleroma
2022-07-26 17:58:42 -07:00
RUN apt-get update &&\
2022-11-06 06:14:23 -08:00
apt-get install -y --no-install-recommends curl ca-certificates imagemagick libmagic-dev ffmpeg libimage-exiftool-perl libncurses5 postgresql-client fasttext &&\
2022-07-26 17:58:42 -07:00
adduser --system --shell /bin/false --home ${HOME} pleroma &&\
mkdir -p ${DATA}/uploads &&\
mkdir -p ${DATA}/static &&\
chown -R pleroma ${DATA} &&\
mkdir -p /etc/pleroma &&\
chown -R pleroma /etc/pleroma &&\
mkdir -p /usr/share/fasttext &&\
curl -L https://dl.fbaipublicfiles.com/fasttext/supervised-models/lid.176.ftz -o /usr/share/fasttext/lid.176.ftz &&\
chmod 0644 /usr/share/fasttext/lid.176.ftz
USER pleroma
2022-07-26 17:58:42 -07:00
COPY --from=build --chown=pleroma:0 /src/release ${HOME}
COPY --chown=pleroma --chmod=640 ./config/docker.exs /etc/pleroma/config.exs
COPY ./docker-entrypoint.sh ${HOME}
ENTRYPOINT ["/opt/pleroma/docker-entrypoint.sh"]