pleroma-docker/Dockerfile

38 lines
832 B
Docker
Raw Normal View History

2018-04-07 20:29:55 +00:00
FROM elixir:1.6-alpine
2018-06-07 11:51:12 +00:00
ENV MIX_HOME /mix
ENV MIX_ARCHIVES /mix-archives
2018-04-07 20:29:55 +00:00
2018-04-08 20:49:07 +00:00
# Prepare system
RUN apk add --no-cache --virtual .build alpine-sdk git rsync
2018-04-09 09:55:52 +00: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 11:51:12 +00:00
# Get the sources
2018-04-08 20:49:07 +00:00
ARG PLEROMA_VERSION
2018-06-07 11:51:12 +00:00
WORKDIR /pleroma
RUN git clone --progress https://git.pleroma.social/pleroma/pleroma.git . && git checkout $PLEROMA_VERSION
2018-04-09 09:55:52 +00:00
# Inject config
ADD ./docker-config.exs /docker-config.exs
RUN \
2018-04-08 20:49:07 +00:00
ln -s /docker-config.exs config/prod.secret.exs && \
ln -s /docker-config.exs config/dev.secret.exs
2018-04-08 14:15:44 +00:00
2018-04-09 09:55:52 +00:00
# Correct paths
WORKDIR /
VOLUME /custom.d
2018-04-08 20:49:07 +00:00
# Register entrypoint
2018-04-08 14:15:44 +00:00
ADD ./entrypoint.ash /
RUN chmod +x /entrypoint.ash
2018-04-08 20:49:07 +00:00
CMD ["/entrypoint.ash"]
2018-04-07 20:29:55 +00:00
2018-04-09 09:55:52 +00:00
# Call entrypoint to precompile pleroma
RUN /entrypoint.ash onbuild
2018-04-07 20:29:55 +00:00
EXPOSE 4000