mirror of
https://github.com/correl/docker-pleroma.git
synced 2024-12-28 19:19:23 +00:00
09fa1e81e3
* expose GID AND UID as optional build args * Give examples on how to use the build-time args in docker-compose * Prevent overwriting of build args * Warn about using regular docker run
40 lines
1.1 KiB
Docker
40 lines
1.1 KiB
Docker
FROM elixir:1.11.4-alpine
|
|
|
|
ARG PLEROMA_VER=develop
|
|
ARG UID=911
|
|
ARG GID=911
|
|
ENV MIX_ENV=prod
|
|
|
|
RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories \
|
|
&& apk update \
|
|
&& apk add git gcc g++ musl-dev make cmake file-dev \
|
|
exiftool imagemagick libmagic ncurses postgresql-client ffmpeg
|
|
|
|
RUN addgroup -g ${GID} pleroma \
|
|
&& adduser -h /pleroma -s /bin/false -D -G pleroma -u ${UID} pleroma
|
|
|
|
ARG DATA=/var/lib/pleroma
|
|
RUN mkdir -p /etc/pleroma \
|
|
&& chown -R pleroma /etc/pleroma \
|
|
&& mkdir -p ${DATA}/uploads \
|
|
&& mkdir -p ${DATA}/static \
|
|
&& chown -R pleroma ${DATA}
|
|
|
|
USER pleroma
|
|
WORKDIR /pleroma
|
|
|
|
RUN git clone -b develop https://git.pleroma.social/pleroma/pleroma.git /pleroma \
|
|
&& git checkout ${PLEROMA_VER}
|
|
|
|
RUN echo "import Mix.Config" > config/prod.secret.exs \
|
|
&& mix local.hex --force \
|
|
&& mix local.rebar --force \
|
|
&& mix deps.get --only prod \
|
|
&& mkdir release \
|
|
&& mix release --path /pleroma
|
|
|
|
COPY ./config.exs /etc/pleroma/config.exs
|
|
|
|
EXPOSE 4000
|
|
|
|
ENTRYPOINT ["/pleroma/docker-entrypoint.sh"]
|