2022-07-26 17:58:42 -07:00
|
|
|
FROM ubuntu:22.04 as build
|
2019-07-31 16:35:14 -07:00
|
|
|
|
2022-08-12 16:28:55 -07:00
|
|
|
ARG MIX_ENV=prod \
|
2022-08-11 16:23:34 -07:00
|
|
|
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 &&\
|
2022-11-05 19:00:24 -07:00
|
|
|
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
|
2019-07-31 16:35:14 -07:00
|
|
|
|
2022-07-26 17:58:42 -07:00
|
|
|
COPY . /src
|
2019-07-31 16:35:14 -07:00
|
|
|
|
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
|
2019-07-31 16:35:14 -07:00
|
|
|
|
2020-01-10 11:09:14 -08:00
|
|
|
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" \
|
2022-11-08 15:25:09 -08:00
|
|
|
org.opencontainers.image.documentation="https://gitlab.com/soapbox-pub/rebased" \
|
2020-01-10 11:09:14 -08:00
|
|
|
org.opencontainers.image.licenses="AGPL-3.0" \
|
2022-07-26 18:00:06 -07:00
|
|
|
org.opencontainers.image.url="https://soapbox.pub" \
|
2020-01-10 11:09:14 -08:00
|
|
|
org.opencontainers.image.revision=$VCS_REF \
|
|
|
|
org.opencontainers.image.created=$BUILD_DATE
|
|
|
|
|
2019-08-02 19:28:48 -07:00
|
|
|
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 &&\
|
2022-11-05 13:54:50 -07:00
|
|
|
chown -R pleroma /etc/pleroma &&\
|
|
|
|
mkdir -p /usr/share/fasttext &&\
|
2022-11-08 15:25:09 -08:00
|
|
|
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
|
2019-07-31 16:35:14 -07:00
|
|
|
|
|
|
|
USER pleroma
|
|
|
|
|
2022-07-26 17:58:42 -07:00
|
|
|
COPY --from=build --chown=pleroma:0 /src/release ${HOME}
|
2019-08-02 19:28:48 -07:00
|
|
|
|
2023-08-05 04:10:35 -07:00
|
|
|
COPY --chown=pleroma --chmod=640 ./config/docker.exs /etc/pleroma/config.exs
|
2019-08-02 19:28:48 -07:00
|
|
|
COPY ./docker-entrypoint.sh ${HOME}
|
|
|
|
|
|
|
|
ENTRYPOINT ["/opt/pleroma/docker-entrypoint.sh"]
|