Skip to content

Instantly share code, notes, and snippets.

@shmink
Created April 3, 2020 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shmink/57e5f23b4016de85ba76e8c3e1cd4da4 to your computer and use it in GitHub Desktop.
Save shmink/57e5f23b4016de85ba76e8c3e1cd4da4 to your computer and use it in GitHub Desktop.
Elixir releases Dockerfile
# ---- Build Stage ----
FROM elixir:1.10-alpine as builder
ENV MIX_ENV=prod
COPY lib ./lib
COPY mix.exs .
COPY mix.lock .
RUN mix local.rebar --force \
&& mix local.hex --force \
&& mix deps.get \
&& mix release
# ---- Application Stage ----
FROM alpine:3
RUN apk add --no-cache --update bash openssl
WORKDIR /app
COPY --from=builder _build/prod/rel/my-app/ .
CMD ["/app/bin/my-app", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment