Skip to content

Commit

Permalink
Make Docker build steps cacheable
Browse files Browse the repository at this point in the history
  • Loading branch information
wmnnd committed Feb 2, 2021
1 parent 2616c5a commit 6146764
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions ops/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
FROM elixir:1.11-alpine as build
ENV MIX_ENV=prod
COPY . .
RUN apk add git npm build-base && \
mix local.hex --force && \

RUN apk add git npm build-base

COPY mix.exs mix.lock ./
COPY config .
RUN mix local.hex --force && \
mix local.rebar --force && \
mix deps.get && \
mix deps.compile

COPY assets/package.json assets/package-lock.json ./assets/
RUN cd assets && \
npm ci

COPY assets ./assets-data
RUN mv assets-data/* assets/ && \
rm -Rf assets-data && \
cd assets && \
npm ci && \
npm run deploy && \
cd .. && \
mix phx.digest && \
npm run deploy

COPY . .
RUN mix phx.digest && \
mix release

FROM elixir:1.11-alpine
Expand Down

0 comments on commit 6146764

Please sign in to comment.