2023-04-25 02:03:59 +02:00
|
|
|
ARG ELIXIR_IMG=hexpm/elixir
|
2022-12-18 19:57:03 +01:00
|
|
|
ARG ELIXIR_VER=1.11.4
|
|
|
|
ARG ERLANG_VER=24.2.1
|
|
|
|
ARG ALPINE_VER=3.17.0
|
|
|
|
|
2023-04-25 02:03:59 +02:00
|
|
|
FROM ${ELIXIR_IMG}:${ELIXIR_VER}-erlang-${ERLANG_VER}-alpine-${ALPINE_VER} as build
|
2019-08-01 01:35:14 +02:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2019-08-03 04:28:48 +02:00
|
|
|
ENV MIX_ENV=prod
|
2019-08-01 01:35:14 +02:00
|
|
|
|
2020-11-12 23:20:17 +01:00
|
|
|
RUN apk add git gcc g++ musl-dev make cmake file-dev &&\
|
2022-09-02 22:35:08 +02:00
|
|
|
echo "import Config" > config/prod.secret.exs &&\
|
2019-08-01 01:35:14 +02:00
|
|
|
mix local.hex --force &&\
|
2019-08-03 04:40:31 +02:00
|
|
|
mix local.rebar --force &&\
|
|
|
|
mix deps.get --only prod &&\
|
2019-08-01 01:35:14 +02:00
|
|
|
mkdir release &&\
|
|
|
|
mix release --path release
|
|
|
|
|
2022-12-18 19:57:03 +01:00
|
|
|
FROM alpine:${ALPINE_VER}
|
2019-08-01 01:35:14 +02:00
|
|
|
|
2020-01-10 20:09:14 +01:00
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VCS_REF
|
|
|
|
|
|
|
|
LABEL maintainer="ops@pleroma.social" \
|
|
|
|
org.opencontainers.image.title="pleroma" \
|
|
|
|
org.opencontainers.image.description="Pleroma for Docker" \
|
|
|
|
org.opencontainers.image.authors="ops@pleroma.social" \
|
|
|
|
org.opencontainers.image.vendor="pleroma.social" \
|
|
|
|
org.opencontainers.image.documentation="https://git.pleroma.social/pleroma/pleroma" \
|
|
|
|
org.opencontainers.image.licenses="AGPL-3.0" \
|
|
|
|
org.opencontainers.image.url="https://pleroma.social" \
|
|
|
|
org.opencontainers.image.revision=$VCS_REF \
|
|
|
|
org.opencontainers.image.created=$BUILD_DATE
|
|
|
|
|
2019-08-03 04:28:48 +02:00
|
|
|
ARG HOME=/opt/pleroma
|
|
|
|
ARG DATA=/var/lib/pleroma
|
|
|
|
|
2021-12-18 00:00:29 +01:00
|
|
|
RUN apk update &&\
|
2021-05-30 16:27:58 +02:00
|
|
|
apk add exiftool ffmpeg imagemagick libmagic ncurses postgresql-client &&\
|
2019-08-03 04:40:31 +02:00
|
|
|
adduser --system --shell /bin/false --home ${HOME} pleroma &&\
|
2019-08-03 04:28:48 +02:00
|
|
|
mkdir -p ${DATA}/uploads &&\
|
|
|
|
mkdir -p ${DATA}/static &&\
|
|
|
|
chown -R pleroma ${DATA} &&\
|
2019-08-01 01:35:14 +02:00
|
|
|
mkdir -p /etc/pleroma &&\
|
|
|
|
chown -R pleroma /etc/pleroma
|
|
|
|
|
|
|
|
USER pleroma
|
|
|
|
|
2019-08-03 04:28:48 +02:00
|
|
|
COPY --from=build --chown=pleroma:0 /release ${HOME}
|
|
|
|
|
2023-08-05 13:10:35 +02:00
|
|
|
COPY --chown=pleroma --chmod=640 ./config/docker.exs /etc/pleroma/config.exs
|
2019-08-03 04:28:48 +02:00
|
|
|
COPY ./docker-entrypoint.sh ${HOME}
|
|
|
|
|
|
|
|
EXPOSE 4000
|
|
|
|
|
|
|
|
ENTRYPOINT ["/opt/pleroma/docker-entrypoint.sh"]
|