Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd56755
commit 34cfc06
Showing
3 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
FROM elixir:1.7.4-alpine | ||
######################### | ||
###### Build Image ###### | ||
######################### | ||
|
||
FROM bitwalker/alpine-elixir:1.9.1 as builder | ||
|
||
ENV MIX_ENV=prod \ | ||
MIX_HOME=/opt/mix \ | ||
HEX_HOME=/opt/hex | ||
MIX_HOME=/opt/mix \ | ||
HEX_HOME=/opt/hex | ||
|
||
RUN mix local.hex --force && \ | ||
mix local.rebar --force | ||
mix local.rebar --force | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN mix deps.get --only-prod && \ | ||
mix deps.compile && \ | ||
mix compile | ||
RUN mix deps.get --only-prod && mix release | ||
|
||
######################### | ||
##### Release Image ##### | ||
######################### | ||
|
||
FROM alpine:3.10 | ||
|
||
RUN apk add --update openssl ncurses | ||
|
||
WORKDIR /app | ||
COPY --from=builder /app/_build/prod/rel/<%= app_name %> ./ | ||
RUN chown -R nobody: /app | ||
|
||
CMD ["mix", "run", "--no-halt"] | ||
ENTRYPOINT ["/app/bin/<%= app_name %>"] | ||
CMD ["start"] |
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