2019-07-31 16:35:14 -07:00
|
|
|
FROM rinpatch/elixir:1.9.0-rc.0-alpine as build
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2019-08-02 19:28:48 -07:00
|
|
|
ENV MIX_ENV=prod
|
2019-07-31 16:35:14 -07:00
|
|
|
|
|
|
|
RUN apk add git gcc g++ musl-dev make &&\
|
|
|
|
echo "import Mix.Config" > config/prod.secret.exs &&\
|
|
|
|
mix local.hex --force &&\
|
|
|
|
mix local.rebar --force
|
|
|
|
|
|
|
|
RUN mix deps.get --only prod &&\
|
|
|
|
mkdir release &&\
|
|
|
|
mix release --path release
|
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
|
2019-08-02 19:28:48 -07:00
|
|
|
ARG HOME=/opt/pleroma
|
|
|
|
ARG DATA=/var/lib/pleroma
|
|
|
|
|
2019-07-31 16:35:14 -07:00
|
|
|
RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\
|
|
|
|
apk update &&\
|
|
|
|
apk add ncurses postgresql-client
|
|
|
|
|
2019-08-02 19:28:48 -07:00
|
|
|
RUN adduser --system --shell /bin/false --home ${HOME} pleroma &&\
|
|
|
|
mkdir -p ${DATA}/uploads &&\
|
|
|
|
mkdir -p ${DATA}/static &&\
|
|
|
|
chown -R pleroma ${DATA} &&\
|
2019-07-31 16:35:14 -07:00
|
|
|
mkdir -p /etc/pleroma &&\
|
|
|
|
chown -R pleroma /etc/pleroma
|
|
|
|
|
|
|
|
USER pleroma
|
|
|
|
|
2019-08-02 19:28:48 -07:00
|
|
|
COPY --from=build --chown=pleroma:0 /release ${HOME}
|
|
|
|
|
|
|
|
COPY ./config/docker.exs /etc/pleroma/config.exs
|
|
|
|
COPY ./docker-entrypoint.sh ${HOME}
|
|
|
|
|
|
|
|
EXPOSE 4000
|
|
|
|
|
|
|
|
ENTRYPOINT ["/opt/pleroma/docker-entrypoint.sh"]
|