2018-04-07 20:29:55 +00:00
|
|
|
FROM elixir:1.6-alpine
|
|
|
|
|
2018-04-09 09:55:52 +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
|
|
|
|
|
|
|
|
# Perform a clone that can be cached
|
2018-04-09 09:55:52 +00:00
|
|
|
WORKDIR /pleroma
|
|
|
|
RUN git clone --progress https://git.pleroma.social/pleroma/pleroma.git .
|
2018-04-08 20:49:07 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
|
# Update pleroma
|
2018-04-08 20:49:07 +00:00
|
|
|
ARG PLEROMA_VERSION
|
|
|
|
RUN \
|
|
|
|
git checkout $PLEROMA_VERSION && \
|
2018-04-09 09:55:52 +00:00
|
|
|
git pull --rebase --autostash
|
|
|
|
|
|
|
|
# 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
|