ARG BASE_IMAGE FROM ${BASE_IMAGE} ARG PKG_FILE ENV MIX_ENV prod # Dockerfile-friendly build release RUN mix local.hex --force && \ mix local.rebar --force COPY mix.exs mix.lock ./ COPY config config COPY apps/fz_http/mix.exs ./apps/fz_http/ COPY apps/fz_wall/mix.exs ./apps/fz_wall/ COPY apps/fz_vpn/mix.exs ./apps/fz_vpn/ COPY apps/fz_common/mix.exs ./apps/fz_common/ RUN mix deps.get --only prod RUN mix deps.compile COPY apps/fz_http/assets/package.json apps/fz_http/assets/package-lock.json ./apps/fz_http/assets/ RUN cd apps/fz_http/assets && npm ci --progress=false --no-audit --loglevel=error COPY apps/fz_http/priv apps/fz_http/priv COPY apps/fz_http/assets apps/fz_http/assets RUN npm run --prefix ./apps/fz_http/assets deploy && \ cd apps/fz_http && mix phx.digest # Copy remaining items for release COPY rel rel COPY config config COPY apps apps RUN mix release RUN tar -zcf $PKG_FILE -C _build/prod/rel/ firezone