pleroma-docker/Dockerfile

38 lines
832 B
Docker
Raw Normal View History

2018-04-07 16:29:55 -04:00
FROM elixir:1.6-alpine
2018-06-07 07:51:12 -04:00
ENV MIX_HOME /mix
ENV MIX_ARCHIVES /mix-archives
2018-04-07 16:29:55 -04:00
2018-04-08 16:49:07 -04:00
# Prepare system
RUN apk add --no-cache --virtual .build alpine-sdk git rsync
2018-04-09 05:55:52 -04:00
# Bust the cache with a build arg
# that is different on every build
ARG __BUST_CACHE
ENV __BUST_CACHE $__BUST_CACHE
2018-06-07 07:51:12 -04:00
# Get the sources
2018-04-08 16:49:07 -04:00
ARG PLEROMA_VERSION
2018-06-07 07:51:12 -04:00
WORKDIR /pleroma
RUN git clone --progress https://git.pleroma.social/pleroma/pleroma.git . && git checkout $PLEROMA_VERSION
2018-04-09 05:55:52 -04:00
# Inject config
ADD ./docker-config.exs /docker-config.exs
RUN \
2018-04-08 16:49:07 -04:00
ln -s /docker-config.exs config/prod.secret.exs && \
ln -s /docker-config.exs config/dev.secret.exs
2018-04-08 10:15:44 -04:00
2018-04-09 05:55:52 -04:00
# Correct paths
WORKDIR /
VOLUME /custom.d
2018-04-08 16:49:07 -04:00
# Register entrypoint
2018-04-08 10:15:44 -04:00
ADD ./entrypoint.ash /
RUN chmod +x /entrypoint.ash
2018-04-08 16:49:07 -04:00
CMD ["/entrypoint.ash"]
2018-04-07 16:29:55 -04:00
2018-04-09 05:55:52 -04:00
# Call entrypoint to precompile pleroma
RUN /entrypoint.ash onbuild
2018-04-07 16:29:55 -04:00
EXPOSE 4000