2019-09-03 09:44:57 -06:00
|
|
|
FROM elixir:1.9-alpine as build
|
2019-07-31 17:35:14 -06:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2019-08-02 20:28:48 -06:00
|
|
|
ENV MIX_ENV=prod
|
2019-07-31 17:35:14 -06:00
|
|
|
|
|
|
|
RUN apk add git gcc g++ musl-dev make &&\
|
|
|
|
echo "import Mix.Config" > config/prod.secret.exs &&\
|
|
|
|
mix local.hex --force &&\
|
2019-08-02 20:40:31 -06:00
|
|
|
mix local.rebar --force &&\
|
|
|
|
mix deps.get --only prod &&\
|
2019-07-31 17:35:14 -06:00
|
|
|
mkdir release &&\
|
|
|
|
mix release --path release
|
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
|
2019-08-02 20:28:48 -06:00
|
|
|
ARG HOME=/opt/pleroma
|
|
|
|
ARG DATA=/var/lib/pleroma
|
|
|
|
|
2019-07-31 17:35:14 -06:00
|
|
|
RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\
|
|
|
|
apk update &&\
|
2019-08-02 20:40:31 -06:00
|
|
|
apk add ncurses postgresql-client &&\
|
|
|
|
adduser --system --shell /bin/false --home ${HOME} pleroma &&\
|
2019-08-02 20:28:48 -06:00
|
|
|
mkdir -p ${DATA}/uploads &&\
|
|
|
|
mkdir -p ${DATA}/static &&\
|
|
|
|
chown -R pleroma ${DATA} &&\
|
2019-07-31 17:35:14 -06:00
|
|
|
mkdir -p /etc/pleroma &&\
|
|
|
|
chown -R pleroma /etc/pleroma
|
|
|
|
|
|
|
|
USER pleroma
|
|
|
|
|
2019-08-02 20:28:48 -06: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"]
|