diff --git a/Dockerfile b/Dockerfile index 5c07a95cb..fff69b308 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,13 +23,17 @@ WORKDIR ${BUILD_DIR} RUN mix local.hex --force \ && mix local.rebar --force -COPY ./mix.exs ./mix.lock ./ - -RUN mix deps.get --only ${MIX_ENV} +RUN \ + --mount=type=cache,target=./deps/,sharing=locked \ + --mount=type=bind,source=./mix.exs,target=./mix.exs,readonly \ + --mount=type=bind,source=./mix.lock,target=./mix.lock,readonly \ + mix deps.get --only ${MIX_ENV} COPY . . -RUN mkdir -p "${BUILD_DIR}_build/" \ +RUN \ + --mount=type=cache,target=./deps/,sharing=locked \ + mkdir -p "${BUILD_DIR}_build/" \ && mix release --path "${BUILD_DIR}_build"