Skip to content

Instantly share code, notes, and snippets.

@KevinDaSilvaS
Created September 23, 2022 23:45
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 KevinDaSilvaS/1c1e8f47b24d0c6ea06792fad2431a0d to your computer and use it in GitHub Desktop.
Save KevinDaSilvaS/1c1e8f47b24d0c6ea06792fad2431a0d to your computer and use it in GitHub Desktop.
dockerfile
FROM elixir as releaser
WORKDIR /app
COPY ./ .
RUN mix local.hex --force
RUN mix local.rebar --force
RUN mix deps.get
RUN mix deps.compile
WORKDIR /app/apps/server
RUN MIX_ENV=prod mix compile
RUN mix phx.digest
WORKDIR /app
RUN MIX_ENV=prod mix release
FROM debian as final
EXPOSE 4000
ENV PORT=4000
ENV MIX_ENV=prod
ENV SHELL=/bin/bash
WORKDIR /app
COPY --from=releaser app/_build/prod/rel/src .
COPY --from=releaser app/ .
CMD ["./bin/src"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment