1 ARG ELIXIR_IMG=hexpm/elixir
6 FROM ${ELIXIR_IMG}:${ELIXIR_VER}-erlang-${ERLANG_VER}-alpine-${ALPINE_VER} as build
11 ENV VIX_COMPILATION_MODE=PLATFORM_PROVIDED_LIBVIPS
13 RUN apk add git gcc g++ musl-dev make cmake file-dev vips-dev &&\
14 echo "import Config" > config/prod.secret.exs &&\
15 mix local.hex --force &&\
16 mix local.rebar --force &&\
17 mix deps.get --only prod &&\
19 mix release --path release
21 FROM alpine:${ALPINE_VER}
26 LABEL maintainer="ops@pleroma.social" \
27 org.opencontainers.image.title="pleroma" \
28 org.opencontainers.image.description="Pleroma for Docker" \
29 org.opencontainers.image.authors="ops@pleroma.social" \
30 org.opencontainers.image.vendor="pleroma.social" \
31 org.opencontainers.image.documentation="https://git.pleroma.social/pleroma/pleroma" \
32 org.opencontainers.image.licenses="AGPL-3.0" \
33 org.opencontainers.image.url="https://pleroma.social" \
34 org.opencontainers.image.revision=$VCS_REF \
35 org.opencontainers.image.created=$BUILD_DATE
38 ARG DATA=/var/lib/pleroma
41 apk add exiftool ffmpeg vips libmagic ncurses postgresql-client &&\
42 adduser --system --shell /bin/false --home ${HOME} pleroma &&\
43 mkdir -p ${DATA}/uploads &&\
44 mkdir -p ${DATA}/static &&\
45 chown -R pleroma ${DATA} &&\
46 mkdir -p /etc/pleroma &&\
47 chown -R pleroma /etc/pleroma
51 COPY --from=build --chown=pleroma:0 /release ${HOME}
53 COPY --chown=pleroma --chmod=640 ./config/docker.exs /etc/pleroma/config.exs
54 COPY ./docker-entrypoint.sh ${HOME}
58 ENTRYPOINT ["/opt/pleroma/docker-entrypoint.sh"]