fix: Rename the intermediate docker images to match CI script
This commit is contained in:
parent
8a6cfa79a0
commit
89d458cd78
1 changed files with 11 additions and 23 deletions
34
Dockerfile
34
Dockerfile
|
@ -1,10 +1,5 @@
|
|||
FROM elixir:1.10.4-alpine AS elixir-builder
|
||||
|
||||
RUN apk add make gcc libc-dev
|
||||
|
||||
ENV CC=gcc
|
||||
ENV MIX_HOME=/opt/mix
|
||||
|
||||
RUN mix local.hex --force \
|
||||
&& mix local.rebar --force
|
||||
|
||||
|
@ -21,23 +16,18 @@ WORKDIR /root/app
|
|||
|
||||
# We load these things one by one so that we can load the deps first and
|
||||
# cache those layers, before we do the app build itself
|
||||
ADD ./config /root/app/config
|
||||
ADD ./mix.exs /root/app/
|
||||
ADD ./mix.lock /root/app/
|
||||
ADD ./apps/admin/mix.exs /root/app/apps/admin/
|
||||
ADD ./apps/app/mix.exs /root/app/apps/app/
|
||||
ADD ./apps/content/mix.exs /root/app/apps/content/
|
||||
ADD ./apps/core/mix.exs /root/app/apps/core/
|
||||
ADD ./_build/${MIX_ENV}/ /root/app/_build/${MIX_ENV}/
|
||||
ADD ./deps/ /root/app/deps/
|
||||
ADD ./script/ /root/app/script/
|
||||
RUN script/restore-timestamps
|
||||
ADD ./mix.exs ./mix.lock ./
|
||||
ADD ./config ./config
|
||||
ADD ./apps/admin/mix.exs ./apps/admin/
|
||||
ADD ./apps/app/mix.exs ./apps/app/
|
||||
ADD ./apps/content/mix.exs ./apps/content/
|
||||
ADD ./apps/core/mix.exs ./apps/core/
|
||||
|
||||
RUN mix deps.get
|
||||
RUN mix deps.compile
|
||||
|
||||
# Leave off here so that we can built assets and compile the elixir app in parallel
|
||||
|
||||
FROM node:15.0
|
||||
FROM node:15.0 AS asset-builder
|
||||
|
||||
# Build assets in a node container
|
||||
ADD ./apps/app/assets/ /root/app/apps/app/assets/
|
||||
|
@ -49,17 +39,15 @@ RUN npm run deploy
|
|||
|
||||
FROM elixir-builder
|
||||
|
||||
RUN mix deps.compile
|
||||
|
||||
ADD ./apps /root/app/apps
|
||||
|
||||
# Resume compilation of the elixir app
|
||||
RUN MAKE=cmake mix compile
|
||||
|
||||
# Copy in the built assets & fingerprint them
|
||||
COPY --from=1 /root/app/apps/app/priv/static/ /root/app/apps/app/priv/static
|
||||
COPY --from=asset-builder /root/app/apps/app/priv/static/ /root/app/apps/app/priv/static
|
||||
RUN mix phx.digest
|
||||
|
||||
RUN script/restore-timestamps
|
||||
|
||||
RUN mkdir -p /root/app/priv/
|
||||
|
||||
CMD elixir --name ${NAME:=legendary}@$(hostname -f) -S mix phx.server
|
||||
|
|
Loading…
Reference in a new issue