elixir-plug-ecto.dockerfile 756 B

12345678910111213141516171819202122232425262728293031323334353637
  1. ARG ELIXIR="1.14.2"
  2. ARG ERLANG="25.1.2"
  3. ARG ALPINE="3.16.2"
  4. ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR}-erlang-${ERLANG}-alpine-${ALPINE}"
  5. ARG RUNNER_IMAGE="alpine:${ALPINE}"
  6. FROM ${BUILDER_IMAGE} AS builder
  7. ARG MIX_ENV="prod"
  8. RUN mix local.hex --force && \
  9. mix local.rebar --force
  10. COPY mix.exs mix.lock ./
  11. RUN mix deps.get --force --only prod
  12. COPY config ./config
  13. RUN mix deps.compile
  14. COPY lib ./lib
  15. RUN mix release --force --path /export
  16. # start a new build stage so that the final image will only contain
  17. # the compiled release and other runtime necessities
  18. FROM ${RUNNER_IMAGE}
  19. RUN apk add --no-cache libstdc++ openssl ncurses-libs
  20. COPY --from=builder /export /opt
  21. EXPOSE 8080
  22. ENTRYPOINT ["/opt/bin/framework_benchmarks"]
  23. CMD ["start"]