1 FROM elixir:1.9-alpine as build
7 RUN apk add git gcc g++ musl-dev make &&\
8 echo "import Mix.Config" > config/prod.secret.exs &&\
9 mix local.hex --force &&\
10 mix local.rebar --force &&\
11 mix deps.get --only prod &&\
13 mix release --path release
18 ARG DATA=/var/lib/pleroma
20 RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\
22 apk add ncurses postgresql-client &&\
23 adduser --system --shell /bin/false --home ${HOME} pleroma &&\
24 mkdir -p ${DATA}/uploads &&\
25 mkdir -p ${DATA}/static &&\
26 chown -R pleroma ${DATA} &&\
27 mkdir -p /etc/pleroma &&\
28 chown -R pleroma /etc/pleroma
32 COPY --from=build --chown=pleroma:0 /release ${HOME}
34 COPY ./config/docker.exs /etc/pleroma/config.exs
35 COPY ./docker-entrypoint.sh ${HOME}
39 ENTRYPOINT ["/opt/pleroma/docker-entrypoint.sh"]