ok this is emberassing

Fixes the caching problem and configuration madness.
Startup on a migrated database takes about 1 to 3 seconds instead of
minutes now. I don't know what went through my head when building
the old stuff.

Let's just pretend all commits up until here never happended.
We good? nice~
This commit is contained in:
sn0w
2019-01-09 21:23:53 +01:00
parent 307d6b01d9
commit 04432bfc8a
8 changed files with 85 additions and 220 deletions

View File

@@ -1,13 +1,13 @@
FROM debian:9-slim
# Set up environment
ENV MIX_ENV=prod
ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
# Prepare mounts
VOLUME /custom.d
VOLUME /conf
# Expose default pleroma port to host
EXPOSE 4000
@@ -39,7 +39,7 @@ 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 /conf $PLEROMA_UPLOADS_PATH
&& chown -R pleroma:pleroma /custom.d $PLEROMA_UPLOADS_PATH
USER pleroma
WORKDIR /home/pleroma
@@ -56,11 +56,6 @@ WORKDIR /home/pleroma/pleroma
ARG __BUST_CACHE
ENV __BUST_CACHE $__BUST_CACHE
# Get rebar and hex
RUN \
mix local.hex --force \
&& mix local.rebar --force
# Fetch changes, checkout
ARG PLEROMA_VERSION
RUN \
@@ -70,12 +65,9 @@ RUN \
# Precompile
RUN \
NO_CONFIG=1 COMPILE_ONLY=1 /entrypoint.sh
# Prepare runtime config
RUN \
ln -sf runtime-config.exs config/prod.secret.exs \
&& ln -sf runtime-config.exs config/dev.secret.exs
cp ./config/dev.exs ./config/prod.secret.exs \
&& BUILDTIME=1 /entrypoint.sh \
&& rm ./config/prod.secret.exs
# Insert overrides
COPY --chown=pleroma:pleroma ./custom.d /home/pleroma/pleroma