-
-
Save watsy0007/51435fdabd331422ab676c6839e3311f to your computer and use it in GitHub Desktop.
This file contains 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