Created
September 4, 2019 20:18
-
-
Save entone/43a79cde4199ecb5b6ddd6b2ce6dbd00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM elixir:1.9.1-alpine as build | |
# # install build dependencies | |
RUN apk add --no-cache \ | |
gcc \ | |
g++ \ | |
git \ | |
make \ | |
musl-dev | |
RUN mix do local.hex --force, local.rebar --force | |
WORKDIR /app | |
FROM build as deps | |
COPY mix.exs mix.lock ./ | |
ARG MIX_ENV=prod | |
ENV MIX_ENV=$MIX_ENV | |
RUN mix do deps.get --only=$MIX_ENV, deps.compile | |
FROM deps as releaser | |
COPY . . | |
ENV MIX_ENV=$MIX_ENV | |
RUN mix release app | |
FROM alpine:3.9 | |
RUN apk add --no-cache bash libstdc++ openssl | |
WORKDIR /app | |
COPY --from=releaser /app/_build/prod/rel/app ./ | |
EXPOSE 4000 | |
ENTRYPOINT ["/app/bin/app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awesome