Fix new config format
This commit is contained in:
57
Dockerfile
57
Dockerfile
@@ -1,61 +1,67 @@
|
||||
FROM debian:9-slim
|
||||
|
||||
VOLUME /custom.d
|
||||
EXPOSE 4000
|
||||
|
||||
# Set up environment
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
|
||||
# Register pseudo-entrypoint
|
||||
ADD ./entrypoint.sh /
|
||||
# Prepare mounts and entrypoint
|
||||
VOLUME /custom.d
|
||||
VOLUME /conf
|
||||
|
||||
COPY ./entrypoint.sh /
|
||||
RUN chmod a+x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
# Get build dependencies
|
||||
# Expose default pleroma port to host
|
||||
EXPOSE 4000
|
||||
|
||||
# Get erlang, elixir, and dependencies
|
||||
RUN \
|
||||
apt-get update \
|
||||
&& apt-get install -y --no-install-recommends apt-utils \
|
||||
&& apt-get install -y --no-install-recommends git wget ca-certificates gnupg2 build-essential \
|
||||
&& apt-get install -y --no-install-recommends git wget ca-certificates gnupg2 build-essential ruby \
|
||||
\
|
||||
&& wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb \
|
||||
&& dpkg -i erlang-solutions_1.0_all.deb \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends esl-erlang elixir \
|
||||
&& apt-get install -y ruby \
|
||||
\
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Limit permissions
|
||||
ARG DOCKER_UID
|
||||
ARG DOCKER_GID
|
||||
ARG PLEROMA_UPLOADS_PATH
|
||||
ARG DOCKER_UID=1000
|
||||
ARG DOCKER_GID=1000
|
||||
ARG PLEROMA_UPLOADS_PATH=/uploads
|
||||
|
||||
RUN \
|
||||
groupadd --gid ${DOCKER_GID} pleroma \
|
||||
&& useradd -m -s /bin/bash --gid ${DOCKER_GID} --uid ${DOCKER_UID} pleroma \
|
||||
&& mkdir -p /custom.d $PLEROMA_UPLOADS_PATH \
|
||||
&& chown -R pleroma:pleroma /custom.d $PLEROMA_UPLOADS_PATH
|
||||
&& chown -R pleroma:pleroma /custom.d /conf $PLEROMA_UPLOADS_PATH
|
||||
|
||||
USER pleroma
|
||||
WORKDIR /home/pleroma
|
||||
|
||||
# Get pleroma
|
||||
# Get pleroma sources
|
||||
RUN git clone --progress https://git.pleroma.social/pleroma/pleroma.git ./pleroma
|
||||
WORKDIR /home/pleroma/pleroma
|
||||
|
||||
# Get rebar/hex
|
||||
# Bust the build cache (if needed)
|
||||
# This works by setting an environment variable with the last
|
||||
# used version/branch/tag/commitish/... which originates in the script.
|
||||
# If the host doesn't have the required tool for "smart version detection"
|
||||
# we'll just use the current timestamp here which forces a rebuild every time.
|
||||
ARG __BUST_CACHE
|
||||
ENV __BUST_CACHE $__BUST_CACHE
|
||||
|
||||
# Get rebar and hex
|
||||
RUN \
|
||||
mix local.hex --force \
|
||||
&& mix local.rebar --force
|
||||
|
||||
# Bust the build cache
|
||||
ARG __BUST_CACHE
|
||||
ENV __BUST_CACHE $__BUST_CACHE
|
||||
|
||||
# Fetch changes, checkout
|
||||
ARG PLEROMA_VERSION
|
||||
|
||||
RUN \
|
||||
git fetch --all \
|
||||
&& git checkout $PLEROMA_VERSION \
|
||||
@@ -66,9 +72,12 @@ RUN \
|
||||
mix deps.get \
|
||||
&& mix compile
|
||||
|
||||
# Insert overrides and config helper
|
||||
COPY --chown=pleroma:pleroma ./docker-config.exs /docker-config.exs
|
||||
COPY --chown=pleroma:pleroma ./custom.d /home/pleroma/pleroma
|
||||
# Prepare runtime config
|
||||
RUN \
|
||||
ln -s /docker-config.exs config/prod.secret.exs \
|
||||
&& ln -s /docker-config.exs config/dev.secret.exs
|
||||
ln -sf runtime-config.exs config/prod.secret.exs \
|
||||
&& ln -sf runtime-config.exs config/dev.secret.exs
|
||||
|
||||
# Insert overrides
|
||||
COPY --chown=pleroma:pleroma ./custom.d /home/pleroma/pleroma
|
||||
|
||||
# Recompiles at runtime if custom.d contained elixir code.
|
||||
|
Reference in New Issue
Block a user