2019-09-03 11:44:57 -04:00
|
|
|
FROM elixir:1.9-alpine as build
|
2019-07-31 19:35:14 -04:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2019-08-02 22:28:48 -04:00
|
|
|
ENV MIX_ENV=prod
|
2019-07-31 19:35:14 -04:00
|
|
|
|
2020-11-12 17:20:17 -05:00
|
|
|
RUN apk add git gcc g++ musl-dev make cmake file-dev &&\
|
2019-07-31 19:35:14 -04:00
|
|
|
echo "import Mix.Config" > config/prod.secret.exs &&\
|
|
|
|
mix local.hex --force &&\
|
2019-08-02 22:40:31 -04:00
|
|
|
mix local.rebar --force &&\
|
|
|
|
mix deps.get --only prod &&\
|
2019-07-31 19:35:14 -04:00
|
|
|
mkdir release &&\
|
|
|
|
mix release --path release
|
|
|
|
|
2020-03-31 21:31:23 -04:00
|
|
|
FROM alpine:3.11
|
2019-07-31 19:35:14 -04:00
|
|
|
|
2020-01-10 14:09:14 -05:00
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VCS_REF
|
|
|
|
|
2021-11-06 11:09:40 -04:00
|
|
|
ARG UID=911
|
|
|
|
ARG GID=911
|
|
|
|
|
2020-01-10 14:09:14 -05:00
|
|
|
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-02 22:28:48 -04:00
|
|
|
ARG HOME=/opt/pleroma
|
|
|
|
ARG DATA=/var/lib/pleroma
|
|
|
|
|
2020-11-18 15:32:30 -05:00
|
|
|
RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\
|
2019-07-31 19:35:14 -04:00
|
|
|
apk update &&\
|
2021-05-30 10:27:58 -04:00
|
|
|
apk add exiftool ffmpeg imagemagick libmagic ncurses postgresql-client &&\
|
2021-11-06 11:09:40 -04:00
|
|
|
adduser --system --shell /bin/false -u $UID -g $GID --home ${HOME} pleroma &&\
|
2019-08-02 22:28:48 -04:00
|
|
|
mkdir -p ${DATA}/uploads &&\
|
|
|
|
mkdir -p ${DATA}/static &&\
|
|
|
|
chown -R pleroma ${DATA} &&\
|
2019-07-31 19:35:14 -04:00
|
|
|
mkdir -p /etc/pleroma &&\
|
|
|
|
chown -R pleroma /etc/pleroma
|
|
|
|
|
|
|
|
USER pleroma
|
|
|
|
|
2019-08-02 22:28:48 -04:00
|
|
|
COPY --from=build --chown=pleroma:0 /release ${HOME}
|
|
|
|
|
|
|
|
COPY ./config/docker.exs /etc/pleroma/config.exs
|
|
|
|
COPY ./docker-entrypoint.sh ${HOME}
|
|
|
|
|
|
|
|
EXPOSE 4000
|
|
|
|
|
2021-11-06 11:09:40 -04:00
|
|
|
CMD ["/bin/ash", "/opt/pleroma/docker-entrypoint.sh"]
|