Last active
October 3, 2020 03:54
-
-
Save entone/b0a70be6132c78909a58d2dfb1c49cbb to your computer and use it in GitHub Desktop.
Elixir 1.9 example Dockerfile
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
/_build/ | |
# If you run "mix test --cover", coverage assets end up here. | |
/cover/ | |
# The directory Mix downloads your dependencies sources to. | |
/deps/ | |
# Where 3rd-party dependencies like ExDoc output generated docs. | |
/doc/ | |
# Ignore .fetch files in case you like to edit your project deps locally. | |
/.fetch | |
# If the VM crashes, it generates a dump, let's ignore it too. | |
erl_crash.dump | |
# Also ignore archive artifacts (built via "mix archive.build"). | |
*.ez | |
/test/ |
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 AS app_builder | |
WORKDIR /app | |
ENV MIX_ENV=prod | |
COPY mix.* | |
RUN mix do local.hex --force, local.rebar --force, deps.get, deps.compile | |
COPY . . | |
RUN mix do phx.digest, release app | |
# ---- Release Stage ---- | |
FROM debian:stretch AS app | |
EXPOSE 4000 | |
ENV LANG=C.UTF-8 | |
RUN apt-get update && apt-get install -y openssl | |
RUN useradd --create-home app | |
WORKDIR /app | |
COPY --from=app_builder /app/_build/prod/rel/app ./ | |
ENTRYPOINT ["/app/bin/app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment