Move compilation into entrypoint; Call entrypoint on build
This commit is contained in:
parent
e8855ead76
commit
3c512c7788
@ -70,8 +70,7 @@ RUN \
|
|||||||
|
|
||||||
# Precompile
|
# Precompile
|
||||||
RUN \
|
RUN \
|
||||||
mix deps.get \
|
NO_CONFIG=1 COMPILE_ONLY=1 /entrypoint.sh
|
||||||
&& mix compile
|
|
||||||
|
|
||||||
# Prepare runtime config
|
# Prepare runtime config
|
||||||
RUN \
|
RUN \
|
||||||
@ -80,5 +79,3 @@ RUN \
|
|||||||
|
|
||||||
# Insert overrides
|
# Insert overrides
|
||||||
COPY --chown=pleroma:pleroma ./custom.d /home/pleroma/pleroma
|
COPY --chown=pleroma:pleroma ./custom.d /home/pleroma/pleroma
|
||||||
|
|
||||||
# Recompiles at runtime if custom.d contained elixir code.
|
|
||||||
|
@ -3,15 +3,20 @@
|
|||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# Generate a config file
|
if [[ -z "$NO_CONFIG" ]]; then
|
||||||
ruby /conf/parser.rb /conf/config.yml > config/runtime-config.exs
|
ruby /conf/parser.rb /conf/config.yml > config/runtime-config.exs
|
||||||
|
fi
|
||||||
|
|
||||||
# Recompile if needed
|
if [[ -n "$COMPILE_ONLY" ]]; then
|
||||||
if [[ ! -z "$RECOMPILE" ]]; then
|
|
||||||
mix deps.get
|
mix deps.get
|
||||||
mix compile
|
mix compile
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Assume that dependencies are compiled and ready to go.
|
||||||
|
# Remove this assumption when https://github.com/erlang/rebar3/issues/1627 is fixed.
|
||||||
|
mix compile
|
||||||
|
|
||||||
# Migrate db
|
# Migrate db
|
||||||
mix ecto.create
|
mix ecto.create
|
||||||
mix ecto.migrate
|
mix ecto.migrate
|
||||||
|
Loading…
Reference in New Issue
Block a user