Dockerfile 591 B

123456789101112131415161718192021222324252627282930
  1. FROM elixir:1.12.2-alpine AS build
  2. # install build dependencies
  3. RUN apk add --no-cache build-base git python3 libstdc++
  4. # prepare build dir
  5. WORKDIR /app
  6. # install hex + rebar
  7. RUN mix local.hex --force && \
  8. mix local.rebar --force
  9. # set build ENV
  10. ENV MIX_ENV=prod
  11. # install mix dependencies
  12. COPY mix.exs mix.lock ./
  13. COPY config config
  14. RUN mix do deps.get, deps.compile
  15. COPY priv priv
  16. RUN mix phx.digest
  17. # compile and build release
  18. COPY lib lib
  19. # uncomment COPY if rel/ exists
  20. # COPY rel rel
  21. RUN mix do compile, release
  22. CMD ["_build/prod/rel/fourletters/bin/fourletters", "start"]